def palindromeQ(num):

  if num%10==num//10000:

    if (num%100)//10==(num//1000)%10:

      return(1)

    else:

      return(0)

  else:

    return(0)

ans=0

A,B=[int(s) for s in input().split()]

for i in range(A,B+1):

  ans+=palindromeQ(i)

print(ans)

  
A,B=[int(s) for s in input().split()]

a=A//100

b=B//100

def pal(num):

  return num*101-num%10-(num//100)*99

ans=b-a-1

if pal(a)>=A:

  ans+=1

if pal(b)<=B:

  ans+=1

print(ans)

  
def palindromeQ(num):
    if num % 10 == num // 10000:
        if (num % 100) // 10 == (num // 1000) % 10:
            return 1
        else:
            return 0
    else:
        return 0


ans = 0
A, B = [int(s) for s in input().split()]
for i in range(A, B + 1):
    ans += palindromeQ(i)
print(ans)

A, B = [int(s) for s in input().split()]
a = A // 100
b = B // 100


def pal(num):
    return num * 101 - num % 10 - (num // 100) * 99


ans = b - a - 1
if pal(a) >= A:
    ans += 1
if pal(b) <= B:
    ans += 1
print(ans)

-def palindromeQ(num): -    if num % 10 == num // 10000: -        if (num % 100) // 10 == (num // 1000) % 10: -            return 1 -        else: -            return 0 -    else: -        return 0 +A, B = [int(s) for s in input().split()] +a = A // 100 +b = B // 100 -ans = 0 -A, B = [int(s) for s in input().split()] -for i in range(A, B + 1): -    ans += palindromeQ(i) +def pal(num): +    return num * 101 - num % 10 - (num // 100) * 99 + + +ans = b - a - 1 +if pal(a) >= A: +    ans += 1 +if pal(b) <= B: +    ans += 1