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

count = 0

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

    j = str(i)

    if j==''.join(reversed(j)):

        count += 1

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

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

print((len(n)))
a, b = list(map(int, input().split()))
count = 0
for i in range(a, b + 1):
    j = str(i)
    if j == "".join(reversed(j)):
        count += 1
print(count)

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

-count = 0 -for i in range(a, b + 1): -    j = str(i) -    if j == "".join(reversed(j)): -        count += 1 -print(count) +n = [i for i in map(str, list(range(a, b + 1))) if i == i[::-1]] +print((len(n)))