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

main = abc159a

abc159a = do
  [n, m] <- getIntList
  print $ comb n + comb m

comb :: Integer -> Integer
comb k
    | k < 2 = 0
    | otherwise = div (k * (fromIntegral k - 1)) 2

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