import sys



def input():

    return sys.stdin.readline().rstrip()



if __name__ == "__main__":

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



    count = 0

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

        if str(i)[0] == str(i)[-1] and str(i)[1] == str(i)[-2]:

            count += 1



    print(count)

import sys



def input():

    return sys.stdin.readline().rstrip()



if __name__ == "__main__":

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



    count = 0

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

        s = str(i)

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

            count += 1



    print(count)

import sys


def input():
    return sys.stdin.readline().rstrip()


if __name__ == "__main__":
    a, b = list(map(int, input().split()))
    count = 0
    for i in range(a, b + 1):
        if str(i)[0] == str(i)[-1] and str(i)[1] == str(i)[-2]:
            count += 1
    print(count)

import sys


def input():
    return sys.stdin.readline().rstrip()


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

-        if str(i)[0] == str(i)[-1] and str(i)[1] == str(i)[-2]: +        s = str(i) +        if s[0] == s[-1] and s[1] == s[-2]: