main :: IO ()
main = do
  [n,m] <- map read . words <$> getLine :: IO [Int]
  case (n,m) of
    (1,1) -> print 0
    (0,mm) -> print mm
    (1,mm) -> print mm
    (nn,mm) -> print $ nn*(nn-1) `div` 2 + mm*(mm-1) `div` 2
