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

j = 0

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

  l = list(str(i))

  l_reverse = list(reversed(l))

  if l == l_reverse:

    j += 1

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



ans = 0

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

    n = str(n)

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

        ans += 1

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

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

-j = 0 -for i in range(A, B + 1): -    l = list(str(i)) -    l_reverse = list(reversed(l)) -    if l == l_reverse: -        j += 1 -print(j) +ans = 0 +for n in range(A, B + 1): +    n = str(n) +    if n == n[::-1]: +        ans += 1 +print(ans)