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

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

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

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

-print((sum(i == i[::-1] for i in map(str, list(range(a, b + 1)))))) +print((len([i for i in map(str, list(range(a, b + 1))) if i == i[::-1]])))