Problems
Digits
Digits
A positive integer which is equal to C^n, where С = 1..9 contains at least K numbers C. For given numbers C and K find the smallest value of N.
Input data
In the input file contains two numbers С and K, K ≤ 500.
Output data
One number N.
Examples
Input example #1
9 2
Output example #1
5