{-# OPTIONS_GHC -O2 #-}
import qualified Control.Arrow         as A
import qualified Data.ByteString.Char8 as BSC8
import qualified Data.Vector.Unboxed   as VU


getI :: BSC8.ByteString -> Maybe (Int, BSC8.ByteString)
getI = fmap (A.second BSC8.tail) . BSC8.readInt
getAB :: IO (Int, Int)
getAB = (\vec -> (vec VU.! 0, vec VU.! 1)) . VU.unfoldrN 2 getI <$> BSC8.getLine

main :: IO ()
main = do
  (n, m) <- getAB
  print $ (n * (n - 1) + m * (m - 1)) `div` 2
