Problems
Digits
Digits
A positive integer which is equal to \textbf{C^n}, where \textbf{С} = \textbf{1}..\textbf{9} contains at least \textbf{K} numbers \textbf{C}. For given numbers \textbf{C} and \textbf{K} find the smallest value of \textbf{N}.
\InputFile
In the input file contains two numbers \textbf{С} and \textbf{K}, \textbf{K} ≤ \textbf{500}.
\OutputFile
One number \textbf{N}.
Input example #1
9 2
Output example #1
5
Example description: 9^5=59049 – set of 2 digit 9.