import qualified Data.ByteString.Char8 as B

main :: IO ()
main = do
  [a, b] <- map read . words <$> getLine
  print $ length $ filter reversible [a .. b]

reversible :: Int -> Bool
reversible n = s == B.reverse s
  where s = B.pack $ show n
