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

count=0

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

  #print(i)

  str_i=str(i)

  for j in range(len(str_i)):

    #print(str_i[j],str_i[-j-1])

    if(str_i[j]!=str_i[-j-1]):

      break

    if(j>(len(str_i)//2+1)):

      #print(i)

      count+=1

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

S=0

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

	Q=str(I)

	R=Q[::-1]

	if R==Q:

		S+=1

print(S)
A, B = list(map(int, input().split()))
count = 0
for i in range(A, B + 1):
    # print(i)
    str_i = str(i)
    for j in range(len(str_i)):
        # print(str_i[j],str_i[-j-1])
        if str_i[j] != str_i[-j - 1]:
            break
        if j > (len(str_i) // 2 + 1):
            # print(i)
            count += 1
print(count)

A, B = list(map(int, input().split()))
S = 0
for I in range(A, B + 1):
    Q = str(I)
    R = Q[::-1]
    if R == Q:
        S += 1
print(S)

-count = 0 -for i in range(A, B + 1): -    # print(i) -    str_i = str(i) -    for j in range(len(str_i)): -        # print(str_i[j],str_i[-j-1]) -        if str_i[j] != str_i[-j - 1]: -            break -        if j > (len(str_i) // 2 + 1): -            # print(i) -            count += 1 -print(count) +S = 0 +for I in range(A, B + 1): +    Q = str(I) +    R = Q[::-1] +    if R == Q: +        S += 1 +print(S)