eolymp
bolt
Try our new interface for solving problems
Problems

The Special Number

The Special Number

In this problem, we assume the positive integer with the following properties are called "\textit{the special number}": \begin{enumerate} \item The special number is a non-negative integer without any leading zero. \item The numbers in every digit of the special number is unique ,in decimal system. \end{enumerate} Of course,it is easy to check whether one integer is a "\textit{the special number}" or not, for instances, \textbf{1532} is the "\textit{the special number}" and \textbf{101} is not. However, we just want to know the quantity of the special numbers that is less than \textbf{N} in this problem. \InputFile The input will consist of a series of signed integers which are not bigger than \textbf{10000000}. one integer per line. (You may assume that there are no more than \textbf{20000} test cases) \OutputFile For each case, output the quantity of the special numbers that is less than \textbf{N} in a single line.
Time limit 2 seconds
Memory limit 64 MiB
Input example #1
10
12
Output example #1
9
10