module Main where

import Control.Applicative
import Control.Monad
import Data.List

isPalindrom :: Int -> Bool
isPalindrom n = xs == (reverse xs)
  where
    xs = show n

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