main = do
  str <- getLine
  let [n, m] = map read (words str) ::[Int]
  print $ cul n m

cul n m
  | n == 1 && m == 1 = 0
  | n <= 1           = culM
  | m <= 1           = culN
  | otherwise        = culN + culM
      where culM = ceiling (fromIntegral (m*(m-1)) / 2)
            culN = ceiling (fromIntegral (n*(n-1)) / 2)