Computational ethnography

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Native inhabitants of the L Island write numbers the other way round: most significant digits of a number are written in the end. For instance, number 144144 is written as 441441.

Novice ethnographer-mathematician Petya is studying square numbers and the culture of Island L's natives. He noticed that some numbers are perfect squares when considered both as regular numbers and as written by Island L's native inhabitants. For instance, number 144144 mentioned above is such a number: when considered as written in usual way 144=122144 = 12^2 and when considered as number 441441 written by natives, then 441=212441 = 21^2. Petya calls such numbers interesting.

Petya is interested how many interesting numbers there are from AA to BB inclusive.

입력

The first line of input contains integer AA, the second line of input contains integer BB (1AB10111 \le A \le B \le 10^{11}).

출력

Output the number of interesting numbers from AA to BB.

힌트

In the first sample test interesting numbers are 11, 44, 99, 121121, 144144, 169169, 441441, 484484, 676676 and 961961. Island L's native inhabitants don't use leading zeros when writing numbers, so 100100 is not an interesting number.