import Data.Char
import Data.List
import System.IO
import Control.Applicative
import Control.Monad
-- https://hoogle.haskell.org で関数検索

{- お客様の中でHaskellを書ける方はいらっしゃいますか？
    と、Haskellの例がなくて困っていたところを @tanakh さんに助けて頂きました。本当にありがとうございました。-}
main :: IO ()
main = do 
    [a,b] <- getIntegerList 
    print $ (a*(a-1)+b*(b-1)) `div` 2
    
{-
main = do
    s <- getLine    
    samecoffee s

samecoffee [x,y,a,b,c,d] 
    | a==b && c==d = do putStrLn "Yes"
    | otherwise         = do putStrLn "No"
samecoffee s = do putStrLn ""
         
putStrLn $ (show c) ++ " " ++ (show a) ++ " " ++ (show b)


main :: IO ()
main = do
    -- 整数の入力
    a <- readLn
    -- スペース区切り整数の入力
    [b, c] <- getIntegerList

    --[b, c] <- map read . words <$> getLine
    -- 文字列の入力
    s <- getLine
    -- 出力
    putStrLn $ show (a + b + c) ++ " " ++ s
-}

-- レイアウト規則

fac 0 = 1
fac n = n * fac (n-1)

-- it ... 前回の結果を保存
-- :l :load  ロードする
-- :set +m 複数行
-- http://www.kotha.net/ghcguide_ja/latest/ghci.html#ghci-introduction 参考資料
--
-- sum read show min max abs 
-- head tail take drop ++ (n:ns)      takewhile dropwhile odd [1..10]
-- zip id const length /= 'div' 'mod' cons
-- fst first(tuple) snd second(tuple) 
--any all 

--ラムダ式　( \x -> x+x )
-- map f [1..10]
--   where f x = x^2 +1

rabs n | n>=0 =n 
           | otherwise = -n
           
xor :: Bool -> Bool -> Bool
xor True    True    = False
xor False  False   = False
xor _         _          = True

halve xs = (take half xs,drop half xs)
        where half = (length  xs) `div` 2
        
safetail xs    
        | xs==[]      = []
        | otherwise = tail xs
        
fibs n = [ x^2 | x <- [1 .. n] ]

factors n = [ k | k <- [1..n] , n `mod` k == 0 ]
prime n = factors n == [1, n]

-- sum xs = foldr (+) 0 xs

compose xs = foldr (.) id xs

count x = length . filter (== x)
rmdups [] = []
rmdups (x:xs) = x: rmdups (filter (/=x) xs)

unfold fin makeele next x 
        | fin x = []
        | otherwise = makeele x : unfold fin makeele next (next x)

int2bit num = unfold (==0) (`mod`2) (`div`2) num 

-- type ...型に別名をつける　再起不可能
-- data ...再帰可能　全く新しい型
-- newtype ...型に別名をつけるが内部上も別物として扱われる　安全性を高めるため使う　再帰可能！
-- instance Eq Bool where
--       False == False = True
--       True  ==  True = True
--       _       ==   _      = False

-- deriving (Eq, Ord, Show, Read)
-- getChar putChar return getLine putStr putStrLn

-- cls = putStr "\ESC[2J"  画面クリア









-- FileName   : 164a
-- CreatedDate: 2020-04-26 20:56:13

--------------------------------------------  https://atcoder.jp/contests/abc164/submissions/12342628

getIntList        = map (read :: String -> Int) . words <$> getLine
getIntegerList    = map (read :: String -> Integer) . words <$> getLine
getIntegerListN m = map (read :: String -> Integer) <$> replicateM m getLine


base :: Integer
base = 1000000007

plus :: Integer -> Integer -> Integer
plus a b = (a+b) `mod` base

times :: Integer -> Integer -> Integer
times a b = a * b `mod` base

minus :: Integer -> Integer -> Integer
minus a b
   | a < b     = a-b + base
   | otherwise = a-b

power :: Integer -> Integer -> Integer
power n k
   | k == 0         = 1
   | k `mod` 2 == 0 = power (times n n) (k`div`2)
   | otherwise      = times n $! power n (k-1)

inv :: Integer -> Integer
inv n = power n $ base - 2

binom :: Integer -> Integer -> Integer
binom n m
   | (n-m) < m = times (foldr times 1 [m+1..n]) $ inv $ foldr times 1 [1..n-m]
   | otherwise = times (foldr times 1 [n-m+1..n]) $ inv $ foldr times 1 [1..m]



















Measured memory_bytes: 508