from collections import Counter,defaultdict,deque

from heapq import heappop,heappush,heapify

import sys,bisect,math,itertools

sys.setrecursionlimit(10**8)

mod = 10**9+7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))



a,b = inpl()

res = 0

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

    tmp = str(i)

    if tmp[0] == tmp[-1] and tmp[1] == tmp[-2]:

        res += 1

print(res) 
from collections import Counter,defaultdict,deque

from heapq import heappop,heappush,heapify

import sys,bisect,math,itertools,fractions,pprint

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))



a,b = inpl()

res = 0

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

    tmp = str(x)

    if tmp == tmp[::-1]:

        res += 1

print(res)
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
import sys, bisect, math, itertools

sys.setrecursionlimit(10**8)
mod = 10**9 + 7


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


def inpln(n):
    return list(int(sys.stdin.readline()) for i in range(n))


a, b = inpl()
res = 0
for i in range(a, b + 1):
    tmp = str(i)
    if tmp[0] == tmp[-1] and tmp[1] == tmp[-2]:
        res += 1
print(res)

from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
import sys, bisect, math, itertools, fractions, pprint

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


a, b = inpl()
res = 0
for x in range(a, b + 1):
    tmp = str(x)
    if tmp == tmp[::-1]:
        res += 1
print(res)

-import sys, bisect, math, itertools +import sys, bisect, math, itertools, fractions, pprint +INF = float("inf") -def inpln(n): -    return list(int(sys.stdin.readline()) for i in range(n)) - - -for i in range(a, b + 1): -    tmp = str(i) -    if tmp[0] == tmp[-1] and tmp[1] == tmp[-2]: +for x in range(a, b + 1): +    tmp = str(x) +    if tmp == tmp[::-1]: