{-# LANGUAGE Strict #-}

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

solve :: Int -> Int -> Int
solve n m = comb2 n + comb2 m

comb2 :: Int -> Int
comb2 n = n * (n - 1) `div` 2
