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

while a<=b:s=str(a);c+=s==s[::-1];a+=1

print(c)
a,b=list(map(int,input().split()));print((sum(s==s[::-1]for s in map(str,list(range(a,b+1))))))
a, b = list(map(int, input().split()))
c = 0
while a <= b:
    s = str(a)
    c += s == s[::-1]
    a += 1
print(c)

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

-c = 0 -while a <= b: -    s = str(a) -    c += s == s[::-1] -    a += 1 -print(c) +print((sum(s == s[::-1] for s in map(str, list(range(a, b + 1))))))