def findSumDigit(num):

    global total

    total = ""

    while num > 0:

        total += str(num % 10)

        num //= 10

    return total



def main():

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

    ans = 0

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

        tmp = str(findSumDigit(i))

        if tmp == str(i):

            ans += 1

    print(ans)



if __name__ == '__main__':

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

ans = 0



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

    seki_gyaku = str(i)

    if seki_gyaku == seki_gyaku[::-1]:

        ans += 1



print(ans)

def findSumDigit(num):
    global total
    total = ""
    while num > 0:
        total += str(num % 10)
        num //= 10
    return total


def main():
    a, b = list(map(int, input().split()))
    ans = 0
    for i in range(a, b + 1):
        tmp = str(findSumDigit(i))
        if tmp == str(i):
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

a, b = list(map(int, input().split()))
ans = 0
for i in range(a, b + 1):
    seki_gyaku = str(i)
    if seki_gyaku == seki_gyaku[::-1]:
        ans += 1
print(ans)

-def findSumDigit(num): -    global total -    total = "" -    while num > 0: -        total += str(num % 10) -        num //= 10 -    return total - - -def main(): -    a, b = list(map(int, input().split())) -    ans = 0 -    for i in range(a, b + 1): -        tmp = str(findSumDigit(i)) -        if tmp == str(i): -            ans += 1 -    print(ans) - - -if __name__ == "__main__": -    main() +a, b = list(map(int, input().split())) +ans = 0 +for i in range(a, b + 1): +    seki_gyaku = str(i) +    if seki_gyaku == seki_gyaku[::-1]: +        ans += 1 +print(ans)