a,b = (int(i) for i in input().split())

ct= 0

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

 judge = str(i)

 if judge == judge[4]+judge[3]+judge[2]+judge[1]+judge[0]:

     ct  += 1

print(ct)
def solve():

  a,b = (int(i) for i in input().split())

  ct = 0

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

    j = str(judge)

    if j[0] == j[4] and j[1] == j[3]:

      ct += 1

  print(ct)

solve()
a, b = (int(i) for i in input().split())
ct = 0
for i in range(a, b + 1):
    judge = str(i)
    if judge == judge[4] + judge[3] + judge[2] + judge[1] + judge[0]:
        ct += 1
print(ct)

def solve():
    a, b = (int(i) for i in input().split())
    ct = 0
    for judge in range(a, b + 1):
        j = str(judge)
        if j[0] == j[4] and j[1] == j[3]:
            ct += 1
    print(ct)


solve()

-a, b = (int(i) for i in input().split()) -ct = 0 -for i in range(a, b + 1): -    judge = str(i) -    if judge == judge[4] + judge[3] + judge[2] + judge[1] + judge[0]: -        ct += 1 -print(ct) +def solve(): +    a, b = (int(i) for i in input().split()) +    ct = 0 +    for judge in range(a, b + 1): +        j = str(judge) +        if j[0] == j[4] and j[1] == j[3]: +            ct += 1 +    print(ct) + + +solve()