main = do
  (a:b:xs) <- map read . words <$> getLine
  putStrLn . show $ solve a b

solve :: Int -> Int -> Int
solve a b = length $ filter id $ map calc [a..b]

calc :: Int -> Bool
calc x = 
  let k = show x
  in k == reverse k