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

tmp=str(a)

c=0

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

    tmp=str(i)

    tmp2=""

    for s in range(len(tmp)):

        tmp2=tmp2+tmp[len(tmp)-1-s]

    if tmp==tmp2:

        c=c+1

print(c)
def main():

    #1. input

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



    ans = 0



    #2. from A to B

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

        #2.1. judge if the number is palindromic

        if (str(i)[0]==str(i)[4]) and (str(i)[1]==str(i)[3]):

            ans = ans+1



    #3. output

    print(ans)





if __name__ == '__main__':

    main()
a, b = list(map(int, input().split()))
tmp = str(a)
c = 0
for i in range(a, b + 1):
    tmp = str(i)
    tmp2 = ""
    for s in range(len(tmp)):
        tmp2 = tmp2 + tmp[len(tmp) - 1 - s]
    if tmp == tmp2:
        c = c + 1
print(c)

def main():
    # 1. input
    a, b = list(map(int, input().split()))
    ans = 0
    # 2. from A to B
    for i in range(a, b + 1):
        # 2.1. judge if the number is palindromic
        if (str(i)[0] == str(i)[4]) and (str(i)[1] == str(i)[3]):
            ans = ans + 1
    # 3. output
    print(ans)


if __name__ == "__main__":
    main()

-a, b = list(map(int, input().split())) -tmp = str(a) -c = 0 -for i in range(a, b + 1): -    tmp = str(i) -    tmp2 = "" -    for s in range(len(tmp)): -        tmp2 = tmp2 + tmp[len(tmp) - 1 - s] -    if tmp == tmp2: -        c = c + 1 -print(c) +def main(): +    # 1. input +    a, b = list(map(int, input().split())) +    ans = 0 +    # 2. from A to B +    for i in range(a, b + 1): +        # 2.1. judge if the number is palindromic +        if (str(i)[0] == str(i)[4]) and (str(i)[1] == str(i)[3]): +            ans = ans + 1 +    # 3. output +    print(ans) + + +if __name__ == "__main__": +    main()