import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T
readInput :: IO [Int]
readInput = map (either error fst . T.decimal) . T.words <$> T.getLine

main = do
  [n, m] <- readInput
  print $ div (n * (n - 1)) 2
    + div (m * (m - 1)) 2