module Main where

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

main :: IO ()
main = do
    [a, b] <- fmap read . words <$> getLine
    let cs = [(c, d) | c <- [1..a], d <- [1..b], c == d]
    print $ length cs