local function split(text, delimiter)
    if text.find(text, delimiter) == nil then
      return { text }
    end
  
    local splited_texts = {}
    local last_position
  
    for splited_text, position in text:gmatch("(.-)"..delimiter.."()") do
      table.insert(splited_texts, splited_text)
      last_position = position
    end
    table.insert(splited_texts, string.sub(text, last_position))
    return splited_texts
end

local str = io.read()
local str_list = split(str, " ")
local str1 = str_list[1]
local str2 = str_list[2]

local count = 0
for i = str1, str2 do
    if(tonumber(i) == tonumber(string.reverse(i))) then
        count = count + 1
    end
end
print(count)