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

n=0

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

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

        n+=1

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



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()))
n = 0
for i in range(A, B + 1):
    if i == int(str(i)[::-1]):
        n += 1
print(n)

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

-n = 0 +ans = 0 -    if i == int(str(i)[::-1]): -        n += 1 -print(n) +    s = str(i) +    if s == s[::-1]: +        ans += 1 +print(ans)