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

ans = 0

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

  s = list(str(i))

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

    ans += 1

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

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

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

-ans = 0 -for i in range(a, b + 1): -    s = list(str(i)) -    if s == s[::-1]: -        ans += 1 -print(ans) +print((sum(str(i) == str(i)[::-1] for i in range(a, b + 1))))