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

print(([str(n)==str(n)[::-1] for n in range(A,B+1)].count(True)))
A,B = list(map(int,input().split()))

ans = 0

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

    s = str(n)

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

        ans += 1

print(ans)
A, B = list(map(int, input().split()))
print(([str(n) == str(n)[::-1] for n in range(A, B + 1)].count(True)))

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

-print(([str(n) == str(n)[::-1] for n in range(A, B + 1)].count(True))) +ans = 0 +for n in range(A, B + 1): +    s = str(n) +    if s == s[::-1]: +        ans += 1 +print(ans)