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



count = 0



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

    x = list(str(i))

    y = x[::-1]

    if x == y:

        count += 1



print(count)

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



count = 0



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

    x = str(i)

    y = x[::-1]

    if x == y:

        count += 1



print(count)

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

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

-    x = list(str(i)) +    x = str(i)