#abc208e. [abc208_e]Digit Products

[abc208_e]Digit Products

Problem Statement

For how many positive integers at most NN is the product of the digits at most KK?

Constraints

  • 1leqNleq10181 \\leq N \\leq 10^{18}
  • 1leqKleq1091 \\leq K \\leq 10^9
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN KK

Output

Print the number of integers satisfying the condition.


Sample Input 1

13 2

Sample Output 1

5

Out of the positive integers at most 1313, there are five such that the product of the digits is at most 22: 11, 22, 1010, 1111, and 1212.


Sample Input 2

100 80

Sample Output 2

99

Out of the positive integers at most 100100, all but 9999 satisfy the condition.


Sample Input 3

1000000000000000000 1000000000

Sample Output 3

841103275147365677

Note that the answer may not fit into a 3232-bit integer.