B. Alphabetic Subsequence
time limit per test
2 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

Davy has a string s consisting of digits '0' to '9'. He wants to replace each digit '0' to '9' with a unique character from 'a' to 'j' in such a way that two equal digits are always replaced with the same character, while two distinct digits are always replaced with distinct characters. Davy is interested in such replacements that there exists a subsequence of the string that is 'abcdefghij'.

Count the number of ways he can do the replacements so that this condition is satisfied. Two replacements are considered to be distinct if there exists a digit that is replaced with distinct characters in these two replacements.

Input

The only line of the input contains a string s consisting of digits from '0' to '9'. The string is non-empty and its length doesn't exceed 100.

Output

Print out a single integer, the number of ways to do replacement that satisfy all the conditions given in the problem statement.

Examples
Input
0123456789
Output
1
Input
01234567899876543210
Output
512