import qualified Data.Vector.Unboxed as VU
import qualified Data.ByteString.Char8 as B

readInt :: B.ByteString -> Maybe (Int,B.ByteString)
readInt xs = do
    (x,ys) <- B.readInt xs
    return (x,B.tail ys)

main :: IO ()
main = do
    (n,m) <- (\vec -> (vec VU.! 0, vec VU.! 1)) . VU.unfoldrN 2 readInt <$> B.getLine
    print $ (n*(n-1) `div` 2) + (m*(m-1) `div` 2)