This problem is a programming version of Problem 152 from projecteuler.net
There are several ways to write the number as a sum of inverse squares using integers.
For instance, the numbers can be used:
In fact, only using integers between and inclusive, there are exactly three ways to do it, the remaining two being: and .
How many ways are there to write the number as a sum of inverse squares using distinct integers between and inclusive?
Input Format
Each test file contains two lines. One the first line there is an integer , on the second line there is an integer .
Constraints
- is a product of digits of some natural number.
- The answer is always
Output Format
Output a single number the answer to the problem.
Sample Input
2
45
Sample Output
3