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

count = 0

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

    n = str(n)

    if n == n[::-1]:

        count += 1

print(count)

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

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

A, B = list(map(int, input().split()))
print((sum(n == n[::-1] for n in map(str, list(range(A, B + 1))))))

-count = 0 -for n in range(A, B + 1): -    n = str(n) -    if n == n[::-1]: -        count += 1 -print(count) +print((sum(n == n[::-1] for n in map(str, list(range(A, B + 1))))))