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

n = b - a + 1

count = 0



for i in range(n):

  x = a + i

  xx = list(str(x))

  xx.reverse()

  xx = int("".join(xx))

  if x == xx:

    count += 1

    

print(count)
a,b=input().split()

ans=0

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

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

    ans+=1

print(ans)
a, b = list(map(int, input().split()))
n = b - a + 1
count = 0
for i in range(n):
    x = a + i
    xx = list(str(x))
    xx.reverse()
    xx = int("".join(xx))
    if x == xx:
        count += 1
print(count)

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

-a, b = list(map(int, input().split())) -n = b - a + 1 -count = 0 -for i in range(n): -    x = a + i -    xx = list(str(x)) -    xx.reverse() -    xx = int("".join(xx)) -    if x == xx: -        count += 1 -print(count) +a, b = input().split() +ans = 0 +for i in range(int(a), int(b) + 1): +    if str(i) == str(i)[::-1]: +        ans += 1 +print(ans)