plusEven :: Integer -> Integer -> Integer

plusEven 1 1 = 0
plusEven n m = (((n-1)*n) `div` 2) + (((m-1)*m) `div` 2) 

toInt x = read x :: Integer

main = do
    nm <- getLine
    let n = head $ map toInt $ words nm
        m = last $ map toInt $ words nm
    print $ plusEven n m