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

c = 0

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

    s = str(i)

    sr = "".join(list(reversed(s)))

    if s== sr:

        c+=1

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

res = 0

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

    s1 = str(i)

    s2 = s1[::-1]

    if s1 == s2:

        res += 1

print(res)
a, b = list(map(int, input().split()))
c = 0
for i in range(a, b + 1):
    s = str(i)
    sr = "".join(list(reversed(s)))
    if s == sr:
        c += 1
print(c)

a, b = list(map(int, input().split()))
res = 0
for i in range(a, b + 1):
    s1 = str(i)
    s2 = s1[::-1]
    if s1 == s2:
        res += 1
print(res)

-c = 0 +res = 0 -    s = str(i) -    sr = "".join(list(reversed(s))) -    if s == sr: -        c += 1 -print(c) +    s1 = str(i) +    s2 = s1[::-1] +    if s1 == s2: +        res += 1 +print(res)