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

cnt=0

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

    n=list(str(i))

    if n==list(reversed(n)):

        cnt+=1

print(cnt)
from sys import stdin

nii=lambda:list(map(int,stdin.readline().split()))

lnii=lambda:list(map(int,stdin.readline().split()))



a,b=nii()

ans=0

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

  s=str(i)

  if s==s[::-1]:

    ans+=1



print(ans)
a, b = list(map(int, input().split()))
cnt = 0
for i in range(a, b + 1):
    n = list(str(i))
    if n == list(reversed(n)):
        cnt += 1
print(cnt)

from sys import stdin

nii = lambda: list(map(int, stdin.readline().split()))
lnii = lambda: list(map(int, stdin.readline().split()))
a, b = nii()
ans = 0
for i in range(a, b + 1):
    s = str(i)
    if s == s[::-1]:
        ans += 1
print(ans)

-a, b = list(map(int, input().split())) -cnt = 0 +from sys import stdin + +nii = lambda: list(map(int, stdin.readline().split())) +lnii = lambda: list(map(int, stdin.readline().split())) +a, b = nii() +ans = 0 -    n = list(str(i)) -    if n == list(reversed(n)): -        cnt += 1 -print(cnt) +    s = str(i) +    if s == s[::-1]: +        ans += 1 +print(ans)