Abdelaleem has an array consisting of an infinite number of all non-zero digits ($$$1, 2, 3, 4, .\dots, 9$$$). Feeling bored (especially in the half hour before the Maghrib prayer during Ramadan), he decided to select any set of digits from the array, calculate their least common multiple (LCM), and then concatenate them together to form a new number. He recorded the value of each new number along with the LCM of the digits used to create it on a piece of paper.
He noticed that there were many numbers he couldn't form because he didn't have the digit zero. So, he decided that before using a number, he could multiply it by $$$10$$$ once and then use it.
For instance, consider the number $$$1910590$$$. Abdelaleem chose the digits $$$1$$$, $$$9$$$, then $$$1$$$ again (multiplied by $$$10$$$), followed by $$$5$$$ and $$$9$$$ (multiplied by $$$10$$$). Concatenating these digits results in $$$1910590$$$ – $$$(1)(9)(10)(5)(90)$$$ , and the LCM of the selected digits is computed as LCM$$$(1,9,10,5,90) = 90$$$.
Since we all know that the half hour before Maghrib in Ramadan lasted for about $$$10$$$ years, he generates all possible numbers that can be generated using the digits he had. After iftar, he challenged his brother Muhammad, who was still in his first year of computer science, asking him, "Can you tell me how many numbers, among all the numbers I've written down on paper, have a value between $$$l$$$ and $$$r$$$, with their LCM equal to $$$k$$$?"
Muhammad, Abdelaleem's brother, thought for a moment until he wrote code to solve this challenge, but Abdelaleem ate a lot and was too lazy to check his brother's code... So, he asked you to calculate the result so he could see if his brother's code was correct or not.
The first and the only line of the input contains three integers $$$l$$$, $$$r$$$, and $$$k$$$ ( $$$1 \leq l,r,k \leq 10^9, l \leq r$$$).
Output one line containing the answer.
12 70 6
9
1 10000 12
350
400 800 2
0
1 1000000000 720
17537385
102 169850 80
1137
In the first test, the numbers that Abdelaleem made are:
$$$16, 23, 26,32,36,61,62,63$$$ and $$$66$$$
| Название |
|---|


