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



count = 0

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

    w = str(q)

    if w[:2] == (w[-1] + w[-2]):

        count += 1

print(count)

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

ans = 0

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

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

        ans += 1

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

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

-A, B = list(map(int, input().split())) -count = 0 -for q in range(A, B + 1): -    w = str(q) -    if w[:2] == (w[-1] + w[-2]): -        count += 1 -print(count) +a, b = list(map(int, input().split())) +ans = 0 +for q in range(a, b + 1): +    if q == int(str(q)[::-1]): +        ans += 1 +print(ans)