A positive integer $$$N$$$, can be transformed to a "Funny Number" by applying a process known as $$$F(N)$$$:
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?
The first and only line of input contains two integer numbers, $$$A$$$ and $$$B$$$ ($$$1 \leq A \leq B \leq 10^6$$$)
Output a line with an integer number, the sum of the "funniness" of al numbers between $$$A$$$ and $$$B$$$ inclusive.
1 5
14
31 31
1