main :: IO ()
main = do
  a:b:_ <- fmap (\x -> read x :: Int) <$> words <$> getLine
  print $ length $ filter isPalindromic [a .. b]
    where
      isPalindromic x = s == reverse s
        where
          s = show x