main :: IO ()
main = do
    n <- (map read) . words <$> getLine
    putStrLn $ show $ solve n


solve :: [Int] -> Int
solve (a:b:_) = length $ filter checkPal [a..b]
    where checkPal x = let s = show x in s == reverse s