Problem: The events have started and one of them is Void fnx, the most anticipated Coding Event of the college. This year, one question has been bugging the coders for hours, Help them solve it. It goes as follows:

The palindromic number 595 can be written as the sum of consecutive squares: from 6 to 12.

Find the sum of all the numbers between a and b (both inclusive) that are both palindromic and can be written as the sum of consecutive squares.

Input: Two numbers a and b.

Output: A single number which is the answer to the question.

Constraints: 1 ≤ a < b ≤ 100000000

SAMPLE INPUT
1 10

SAMPLE OUTPUT
5

Explanation

There is only one such number between 1 and 10 which can be written as the sum of consecutive squares i.e. 11 + 22 = 5.

Solution (in PYTHON):

Solution:
def is_palindromic(n):
	n=str(n)
	for i in range(0,int((len(n)+1)/2)):
		if n[i]!=n[len(n)-i-1]:
			return False
	return True
		
	
	
	

p=raw_input()
a,b = [int(i) for i in p.split()]

start=int(a**0.5)
end=int(b**0.5)
pal = set()

for i in range(1, end-1):
    sos = i*i
    for j in range(i+1, end):
        sos += j*j
        if sos >= b: break
        if  sos>=a and is_palindromic(sos) : pal.add(sos)
        
print sum(pal)