# vim: fileencoding=utf-8





def main():

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

    c = 0

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

        s = str(i)

        r = "".join(reversed(list(s)))

        if s == r:

            c += 1

    print(c)





if __name__ == "__main__":

    main()

# vim: fileencoding=utf-8





def main():

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

    c = 0

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

        #     s = str(i)

        #     r = "".join(reversed(list(s)))

        #     if s == r:

        #         c += 1

        if (i % 10) == (i // 10000 % 10) and (i // 10 % 10) == (i // 1000 % 10):

            c += 1

    print(c)





if __name__ == "__main__":

    main()

# vim: fileencoding=utf-8
def main():
    a, b = list(map(int, input().split()))
    c = 0
    for i in range(a, b + 1):
        s = str(i)
        r = "".join(reversed(list(s)))
        if s == r:
            c += 1
    print(c)


if __name__ == "__main__":
    main()

# vim: fileencoding=utf-8
def main():
    a, b = list(map(int, input().split()))
    c = 0
    for i in range(a, b + 1):
        #     s = str(i)
        #     r = "".join(reversed(list(s)))
        #     if s == r:
        #         c += 1
        if (i % 10) == (i // 10000 % 10) and (i // 10 % 10) == (i // 1000 % 10):
            c += 1
    print(c)


if __name__ == "__main__":
    main()

-        s = str(i) -        r = "".join(reversed(list(s))) -        if s == r: +        #     s = str(i) +        #     r = "".join(reversed(list(s))) +        #     if s == r: +        #         c += 1 +        if (i % 10) == (i // 10000 % 10) and (i // 10 % 10) == (i // 1000 % 10):