A,B=list(map(int,input().split()))

count=0

for i in range(A,B+1):

    if list(str(i)) == list(reversed(str(i))):



        count+=1



        

print(count)

A,B=list(map(int,input().split()))

count=0

for i in range(A,B+1):

    if str(i) == ''.join(reversed(str(i))):



        count+=1



        

print(count)

A, B = list(map(int, input().split()))
count = 0
for i in range(A, B + 1):
    if list(str(i)) == list(reversed(str(i))):
        count += 1
print(count)

A, B = list(map(int, input().split()))
count = 0
for i in range(A, B + 1):
    if str(i) == "".join(reversed(str(i))):
        count += 1
print(count)

-    if list(str(i)) == list(reversed(str(i))): +    if str(i) == "".join(reversed(str(i))):