{-# LANGUAGE OverloadedStrings   #-}
{-# LANGUAGE ScopedTypeVariables #-}

import           Control.Monad
import           Data.IORef
import qualified Data.Text     as T
import qualified Data.Text.IO  as T
import           System.IO

(+.+) = T.append
(!.!) = T.index

main :: IO ()
main = palindromicNumbers

palindromicNumbers :: IO ()
palindromicNumbers = do
  ab <- T.getLine
  let [aT, bT] = T.split (== ' ') ab
      a = read $ T.unpack aT :: Int
      b = read $ T.unpack bT :: Int
      ans = length [n | n <- [a..b], let nT = T.pack $ show n in T.reverse nT == nT]
  print ans