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

k = 0



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

    s = str(i)

    if s[0]==s[-1] and s[1] == s[-2]:

        k += 1

print(('{}'.format(k)))





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

ans = 0

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

    moji = str(i)

    if moji[0] == moji[4] and moji[1] == moji[3]:

        ans += 1

print(ans)
a, b = list(map(int, input().split()))
k = 0
for i in range(a, b + 1):
    s = str(i)
    if s[0] == s[-1] and s[1] == s[-2]:
        k += 1
print(("{}".format(k)))

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

-a, b = list(map(int, input().split())) -k = 0 -for i in range(a, b + 1): -    s = str(i) -    if s[0] == s[-1] and s[1] == s[-2]: -        k += 1 -print(("{}".format(k))) +A, B = list(map(int, input().split())) +ans = 0 +for i in range(A, B + 1): +    moji = str(i) +    if moji[0] == moji[4] and moji[1] == moji[3]: +        ans += 1 +print(ans)