{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import qualified Data.ByteString.Char8 as BC
import           Data.Maybe            (fromJust)

main :: IO ()
main = do
  [a, b] <- getInts
  print $ solve a b

solve :: Int -> Int -> Int
solve a b = length $ filter isPalindromic [a .. b]

isPalindromic :: Int -> Bool
isPalindromic n = s == reverse s where
  s = show n

readInts :: BC.ByteString -> [Int]
readInts = map (fst . fromJust . BC.readInt) . BC.words

getInts :: IO [Int]
getInts = readInts <$> BC.getLine
