import Control.Applicative

main :: IO ()
main = do
    [a, b] <- map read . words <$> getLine
    putStrLn $ show (solve a b)
    
solve :: Int -> Int -> Int
solve a b = length [(x,y) | x <- [1..a], y <- [1..b], x == y]