local flo = math.floor

local function div_flo(divided, dividing)
	return flo(divided / dividing)
end

local A, B = io.read("*n", "*n")

local div_A = div_flo(A, 100)
local div_B = div_flo(B, 100)

local count = 0
for i = div_A, div_B do
	local pal = tonumber(tostring(i)..tostring(div_flo(i, 10)):reverse())
	if A <= pal and pal <= B  then
		count = count + 1
	end
end

print(count)