import           Data.List

fact = product . (`take` [1 ..])

combination n k = round $ fact n / (fact k * fact (n - k))

main = do
  [n, m] <- map read . words <$> getLine
  print $ (combination n 2) + (combination m 2)
