F. Funny Numbers
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

A positive integer $$$N$$$, can be transformed to a "Funny Number" by applying a process known as $$$F(N)$$$:

  • Break the number on each of its digits.
  • Multiply each digit by itself.
  • Sum all the values

For example to transform $$$F(23) = 2*2 + 3*3 = 4 + 9 = 13$$$.

It can be seen that we can apply the same process several times, as the resulting "Funny Number" can be transformed into another "Funny Number". Consider the sequence of numbers formed by $$$N$$$, $$$F(N)$$$, $$$F(F(N))$$$, $$$F(F(F(N)))$$$ and so on. This is, the sequence consists of $$$N$$$, its "Funny Number", and the numbers resulting of applying the process to each previous resulting number. The "Funniness" of the number $$$N$$$ is equal to the smallest number on this sequence.

Given two numbers $$$A$$$ and $$$B$$$, can you find the sum of the "funniness" of all numbers between $$$A$$$ and $$$B$$$, inclusive?

Input

The first and only line of input contains two integer numbers, $$$A$$$ and $$$B$$$ ($$$1 \leq A \leq B \leq 10^6$$$)

Output

Output a line with an integer number, the sum of the "funniness" of al numbers between $$$A$$$ and $$$B$$$ inclusive.

Examples
Input
1 5
Output
14
Input
31 31
Output
1