# ABC090B - Palindromic Numbers

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

count = 0

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

    lst = list(map(int, list(str(i))))

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

        count += 1

print(count)
# ABC090B - Palindromic Numbers

def main():

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

    cnt = 0

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

        s = str(i)

        if s == s[::-1]:

            cnt += 1

    print(cnt)





if __name__ == "__main__":

    main()
# ABC090B - Palindromic Numbers
a, b = list(map(int, input().rstrip().split()))
count = 0
for i in range(a, b + 1):
    lst = list(map(int, list(str(i))))
    if lst[0] == lst[4] and lst[1] == lst[3]:
        count += 1
print(count)

# ABC090B - Palindromic Numbers
def main():
    a, b = list(map(int, input().rstrip().split()))
    cnt = 0
    for i in range(a, b + 1):
        s = str(i)
        if s == s[::-1]:
            cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()

-a, b = list(map(int, input().rstrip().split())) -count = 0 -for i in range(a, b + 1): -    lst = list(map(int, list(str(i)))) -    if lst[0] == lst[4] and lst[1] == lst[3]: -        count += 1 -print(count) +def main(): +    a, b = list(map(int, input().rstrip().split())) +    cnt = 0 +    for i in range(a, b + 1): +        s = str(i) +        if s == s[::-1]: +            cnt += 1 +    print(cnt) + + +if __name__ == "__main__": +    main()