



import numpy as np



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

ans=0



def check(x):

    s=str(x)

    for i in range(len(s)):

        if(s[i]!=s[len(s)-1-i]):return False

    return True



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

    if(check(i)):ans+=1

print(ans)




import numpy as np



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

ans=0



def check(x):

    s=str(x)

    return s==s[::-1]



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

    if(check(i)):ans+=1

print(ans)
import numpy as np

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


def check(x):
    s = str(x)
    for i in range(len(s)):
        if s[i] != s[len(s) - 1 - i]:
            return False
    return True


for i in range(a, b + 1):
    if check(i):
        ans += 1
print(ans)

import numpy as np

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


def check(x):
    s = str(x)
    return s == s[::-1]


for i in range(a, b + 1):
    if check(i):
        ans += 1
print(ans)

-    for i in range(len(s)): -        if s[i] != s[len(s) - 1 - i]: -            return False -    return True +    return s == s[::-1]