a,b=list(map(int,input().split()))

count=0

for i in range(a,b+1):

    if str(i)==str(i)[::-1]:

        count+=1

print(count)
a,b=list(map(int,input().split()))

print((sum(i==i[::-1]for i in map(str,list(range(a,b+1))))))
a, b = list(map(int, input().split()))
count = 0
for i in range(a, b + 1):
    if str(i) == str(i)[::-1]:
        count += 1
print(count)

a, b = list(map(int, input().split()))
print((sum(i == i[::-1] for i in map(str, list(range(a, b + 1))))))

-count = 0 -for i in range(a, b + 1): -    if str(i) == str(i)[::-1]: -        count += 1 -print(count) +print((sum(i == i[::-1] for i in map(str, list(range(a, b + 1))))))