import Control.Monad
import Data.List
import qualified Data.ByteString.Lazy.Char8 as B

main = do
  input <- B.getContents
  let [a,b] = map readInt . B.words $ input
  print (solve a b)

readInt :: B.ByteString -> Int
readInt s = case B.readInt s of Just (n,_) -> n

solve :: Int -> Int -> Int
solve a b =
  length [(i,i) |i<-[1..12], (i,i)<=(a,b)]