solve n m
  | n <= 1 && m <= 1 = 0
  | n <= 1 = m * (m-1) `div` 2
  | otherwise = n * (n-1) `div` 2 + m * (m-1) `div` 2 

main = do
  [n,m] <- map read . words <$> getLine :: IO [Int]
  print $ solve n m
