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

ans = 0

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

  x = str(i)

  flag = 1

  for j in range(len(x) // 2):

    if x[j] != x[-(j+1)]:

      flag = 0

  ans += flag

print(ans)
def is_palindrome(s):

    for i in range(len(s) // 2 + 1):

        if s[i] != s[-i-1]:

            return False

    return True





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



ans = 0

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

  if is_palindrome(str(i)):

  	ans += 1

print(ans)
a, b = list(map(int, input().split()))
ans = 0
for i in range(a, b + 1):
    x = str(i)
    flag = 1
    for j in range(len(x) // 2):
        if x[j] != x[-(j + 1)]:
            flag = 0
    ans += flag
print(ans)

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


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

+def is_palindrome(s): +    for i in range(len(s) // 2 + 1): +        if s[i] != s[-i - 1]: +            return False +    return True + + -    x = str(i) -    flag = 1 -    for j in range(len(x) // 2): -        if x[j] != x[-(j + 1)]: -            flag = 0 -    ans += flag +    if is_palindrome(str(i)): +        ans += 1