import Control.Applicative

main :: IO ()
main = do
  ns <- (map read . words) <$> getLine :: IO [Int]
  putStrLn $ show $ solve ns

solve :: [Int] -> Int
solve (s:e:_) = length [x | x <- [s..e], isPalindrome x]
  where
    isPalindrome n = show n == (reverse $ show n)
