a,b=list(map(int,input().split()))

import itertools

a1 = len(list(itertools.combinations(list(range(a)), 2)))

b1 = len(list(itertools.combinations(list(range(b)), 2)))

print((a1+b1))
a,b=list(map(int,input().split()))

print((a*(a-1)//2+b*(b-1)//2))
a, b = list(map(int, input().split()))
import itertools

a1 = len(list(itertools.combinations(list(range(a)), 2)))
b1 = len(list(itertools.combinations(list(range(b)), 2)))
print((a1 + b1))

a, b = list(map(int, input().split()))
print((a * (a - 1) // 2 + b * (b - 1) // 2))

-import itertools - -a1 = len(list(itertools.combinations(list(range(a)), 2))) -b1 = len(list(itertools.combinations(list(range(b)), 2))) -print((a1 + b1)) +print((a * (a - 1) // 2 + b * (b - 1) // 2))