Like 3#2771

Like 3

0.1 seconds
64 megabytes
Easy

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 .

Input

The program receives two numbers and given in a single line, separated by a space (1 \leq A \leq B \leq 10^{39}).

Output

Output a single number — the number of triplet-like numbers in the specified range.

Examples

Example 1

Loading
Loading