# coding: utf-8

import sys

input = sys.stdin.readline



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

ans = sum(1 for i in range(A, B+1) if str(i)==str(i)[::-1])

print(ans)

# coding: utf-8

import sys

input = sys.stdin.readline



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

ans = 0

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

    i = str(i)

    if i == i[::-1]:

        ans += 1

print(ans)

# coding: utf-8
import sys

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

# coding: utf-8
import sys

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

-ans = sum(1 for i in range(A, B + 1) if str(i) == str(i)[::-1]) +ans = 0 +for i in range(A, B + 1): +    i = str(i) +    if i == i[::-1]: +        ans += 1