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



nums = [x for x in range(a, b+1) if str(x)[0] == str(x)[-1] and str(x)[1] == str(x)[-2]]

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



nums = []



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

    str_i = str(i)

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

        nums.append(i)



print((len(nums)))
a, b = list(map(int, input().split()))
nums = [
    x for x in range(a, b + 1) if str(x)[0] == str(x)[-1] and str(x)[1] == str(x)[-2]
]
print((len(nums)))

a, b = list(map(int, input().split()))
nums = []
for i in range(a, b + 1):
    str_i = str(i)
    if str_i[0] == str_i[-1] and str_i[1] == str_i[-2]:
        nums.append(i)
print((len(nums)))

-nums = [ -    x for x in range(a, b + 1) if str(x)[0] == str(x)[-1] and str(x)[1] == str(x)[-2] -] +nums = [] +for i in range(a, b + 1): +    str_i = str(i) +    if str_i[0] == str_i[-1] and str_i[1] == str_i[-2]: +        nums.append(i)