A sort riddle is a game in which you guess the original English word from a string of letters in an English word, rearranged in alphabetical order.
For example, if you are given the string aet, you can guess that the original English word was eat, ate, and so on.
To play this game, PCK, who is not good at English words, decided to think of the given string and all the strings that are rearranged.
Given a rearranged string, write a program to output the number of strings that PCK will consider.
The input is given in the following format.
$str$
A string $str$ rearranged into a single line is given. $str$ contains only lowercase letters, and its length is between 1 and 8. Also, each character is arranged in alphabetical order from the beginning.
Output the number of strings that PCK will think about.
aet
6
eeei
4