102250: [AtCoder]ABC225 A - Distinct Strings

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $100$ points

Problem Statement

You are given a string $S$ of length $3$ consisting of lowercase English letters.

How many different strings can be obtained by permuting the characters in $S$?

Constraints

  • $S$ is a string $S$ of length $3$ consisting of lowercase English letters.

Input

Input is given from Standard Input in the following format:

$S$

Output

Print the number of different strings that can be obtained by permuting the characters in $S$.


Sample Input 1

aba

Sample Output 1

3

By permuting the characters in $S=$ aba, three different strings can be obtained: aab, aba, baa.


Sample Input 2

ccc

Sample Output 2

1

By permuting the characters in $S=$ ccc, just one string can be obtained: ccc.


Sample Input 3

xyz

Sample Output 3

6

By permuting the characters in $S=$ xyz, six different strings can be obtained: xyz, xzy, yxz, yzx, zxy, zyx.

Input

题意翻译

输入一个长度为 $3$ 的,全部由英文小写字母组成的字符串 $s$ ,求将 $s$ 的所有字符重新排列后能得到多少种不同的字符串。

Output

得分:100分 部分 问题描述 给你一个长度为3的小写英文字母组成的字符串S。 可以通过对S中的字符进行排列得到多少个不同的字符串? 部分 约束 -S是一个长度为3的小写英文字母组成的字符串。 输入 输入格式如下: S 输出 打印可以通过对S中的字符进行排列得到的不同字符串的数量。 输入样例1 aba 输出样例1 3 通过排列S中的字符,可以得到三个不同的字符串:aab、aba和baa。 输入样例2 ccc 输出样例2 1 通过排列S中的字符,只能得到一个字符串:ccc。 输入样例3 xyz 输出样例3 6 通过排列S中的字符,可以得到六个不同的字符串:xyz、xzy、yxz、yzx、zxy和zyx。

加入题单

算法标签: