In this problem, we define a positive integer as a special number if it satisfies the following properties:
It is a positive integer with no leading zeros.
All of its digits are unique in the decimal system.
It is straightforward to determine whether an integer is a special number. For example, is a special number, but is not. In this problem, we want to find out how many special numbers are less than .
The input consists of a series of positive integers, each not exceeding , with one integer per line (the number of test cases does not exceed ).
For each test case, print the number of special numbers less than on a separate line.
Example 1