from scipy.misc import comb

n, m = list(map(int,input().split()))



ans = comb(n,2,exact=True) + comb(m,2,exact=True) #exact=Trueで整数値が返される

print(ans)
n, m = list(map(int,input().split()))



if n <= 1:

    N =0

else:

    N = n*(n-1)/2

if m <= 1:

    M = 0

else:

    M = m*(m-1)/2

print((int(N+M)))
from scipy.misc import comb

n, m = list(map(int, input().split()))
ans = comb(n, 2, exact=True) + comb(m, 2, exact=True)  # exact=Trueで整数値が返される
print(ans)

n, m = list(map(int, input().split()))
if n <= 1:
    N = 0
else:
    N = n * (n - 1) / 2
if m <= 1:
    M = 0
else:
    M = m * (m - 1) / 2
print((int(N + M)))

-from scipy.misc import comb - -ans = comb(n, 2, exact=True) + comb(m, 2, exact=True)  # exact=Trueで整数値が返される -print(ans) +if n <= 1: +    N = 0 +else: +    N = n * (n - 1) / 2 +if m <= 1: +    M = 0 +else: +    M = m * (m - 1) / 2 +print((int(N + M)))