JMU CS280 SP18 WK08

Start

2018-02-27 21:30 CET

JMU CS280 SP18 WK08

End

2018-03-03 05:59 CET
The end is near!
Contest is over.
Not yet started.
Contest is starting in -234 days 17:58:52

Time elapsed

80:29:00

Time remaining

0:00:00

Problem A
Anagram Counting

An anagram is a reordering of the letters in a word of phrase. For example, you can rearrange the letters of terraced to get the word retraced. Rearranging them some more will give you the word cratered. You can even make dactrere and redatrec, which are both anagrams of terraced even if they are not legitimate English words.

Input

Input contains up to $200$ words, one per line. Each word consists of upper- and lower-case letters (a–z) and may have as many as $100$ characters. Input ends at end of file.

Output

For every input word, output the total number of unique anagrams that can be made from it. For the purpose of this problem, upper- and lower-case letters are considered distinct.

Sample Input 1 Sample Output 1
at
ordeals
abcdefghijklmnopqrstuvwxyz
abcdefghijklmabcdefghijklm
abcdABCDabcd
2
5040
403291461126605635584000000
49229914688306352000000
29937600