module Main where

import           Control.Monad
import           Data.List
import           Data.Ord
import           Data.List.Split
import           Data.Array.IO
import qualified Data.Vector.Unboxed as V

main :: IO ()
main = do
  [a, b] <- map read . words <$> getLine :: IO [Int]
  print . length $ filter ok [a .. b]
  where
    ok a = let s = show a 
           in s == reverse s
