{-# OPTIONS_GHC -O2 #-}
import qualified Data.ByteString.Char8 as BSC8
import qualified Data.Maybe            as Maybe

readInts :: IO [Int]
readInts = map (fst . Maybe.fromJust . BSC8.readInt ) . BSC8.words <$> BSC8.getLine

main :: IO ()
main = do
  [n, m] <- readInts
  print $ (n * n - n + m * m - m) `div` 2
