import Control.Applicative ((<$>))

main :: IO ()
main = solve <$> map read <$> words <$> getLine >>= print
  

solve :: [Int] -> Int
solve [a,b] = length . filter f $ [a .. b]
  where
    f = (reverse >>= (==)) . show
