import Control.Applicative

main :: IO ()
main = solve <$> f >>= print
  where
    f = map read <$> words <$> getLine

solve :: [Int] -> Int
solve [n, m] = f n + f m
  where
    f x = x * (x - 1) `div` 2
