The dig$it-pr$oduct of a positive integer is the product of the number's decimal digits. For example, the dig$it-pr$oduct of 2612 is $2 \cdot 6 \cdot 1 \cdot 2 = 24$. The se$lf-pr$oduct of a number is the product of the number and its dig$it-pr$oduct. For example, the se$lf-pr$oduct of 2612 is $2612 \cdot 24 = 62688$. Write a program that, given two positive integers A and B, calculates the number of positive integers whose se$lf-pr$oduct is between A and B, inclusive.
Input
The first and only line contains two integers A and B ($1 \le A \le B < 10^{18}$).
Output
Output should consist of a single integer, the number of positive integers whose twist is between A and B.
Constraints
In test cases worth a total of 25 points, A and B will be at most $10^{8}$. In test cases worth another 15, A and B will be at most $10^{12}$.
Example 1
20 30
2
Example 2
145 192
4
Example 3
2224222 2224222
1
Clarification of second example. The self-products of numbers 19, 24, 32 i 41 are in order 171, 192, 192 and 164.
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.