A, B = list(map(int, input().split(' ')))



def is_palindromic(n):

    sep_idx = len(n) // 2

    if n[:sep_idx] == n[sep_idx+1:][::-1]:

        return True

    return False



count = 0

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

    n_str = str(n)

    if is_palindromic(n_str):

        count += 1

print(count)
A, B = list(map(int, input().split(' ')))



def is_palindromic(n):

    s, t = n % 10, (n // 10000) % 10

    u, v = (n // 10) % 10, (n // 1000) % 10

    if s == t and u == v:

        return True

    return False



count = 0

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

    if is_palindromic(n):

        count += 1

print(count)
A, B = list(map(int, input().split(" ")))


def is_palindromic(n):
    sep_idx = len(n) // 2
    if n[:sep_idx] == n[sep_idx + 1 :][::-1]:
        return True
    return False


count = 0
for n in range(A, B + 1):
    n_str = str(n)
    if is_palindromic(n_str):
        count += 1
print(count)

A, B = list(map(int, input().split(" ")))


def is_palindromic(n):
    s, t = n % 10, (n // 10000) % 10
    u, v = (n // 10) % 10, (n // 1000) % 10
    if s == t and u == v:
        return True
    return False


count = 0
for n in range(A, B + 1):
    if is_palindromic(n):
        count += 1
print(count)

-    sep_idx = len(n) // 2 -    if n[:sep_idx] == n[sep_idx + 1 :][::-1]: +    s, t = n % 10, (n // 10000) % 10 +    u, v = (n // 10) % 10, (n // 1000) % 10 +    if s == t and u == v: -    n_str = str(n) -    if is_palindromic(n_str): +    if is_palindromic(n):