Let's call a natural number "triplet-like" if its digits consist only of those digits that can be represented as integer powers of the number . Find the number of triplet-like numbers in the interval .
The program receives two numbers and given in a single line, separated by a space (1 \leq A \leq B \leq 10^{39}).
Output a single number — the number of triplet-like numbers in the specified range.
Example 1