import           Control.Monad
import qualified Data.ByteString.Char8 as BS
import           Data.Maybe

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
  [n, m] <- getIntList
  let c1 = if n > 1 then n * (n-1) else 0
      c2 = if m > 1 then m * (m-1) else 0
      ans = (c1 + c2) `div` 2
  print ans