import itertools

N,M=list(map(int,input().split()))

l=[]

t=1

for i in range(N):

   l.append(t)

   t+=2

t=2

for i in range(M):

   l.append(t)

   t+=2

count=0

for v in itertools.combinations(l,2):

    #print(v[0],v[1])

    if (v[0]+v[1])%2==0:

        count+=1

print(count)
import math

def combinations_count(n,r):

    if n<r:

        return 0

    # c=n!/(r!*(n-r)!)

    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))

N,M=list(map(int,input().split()))

print((combinations_count(N,2)+combinations_count(M,2)))
import itertools

N, M = list(map(int, input().split()))
l = []
t = 1
for i in range(N):
    l.append(t)
    t += 2
t = 2
for i in range(M):
    l.append(t)
    t += 2
count = 0
for v in itertools.combinations(l, 2):
    # print(v[0],v[1])
    if (v[0] + v[1]) % 2 == 0:
        count += 1
print(count)

import math


def combinations_count(n, r):
    if n < r:
        return 0
    # c=n!/(r!*(n-r)!)
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


N, M = list(map(int, input().split()))
print((combinations_count(N, 2) + combinations_count(M, 2)))

-import itertools +import math + + +def combinations_count(n, r): +    if n < r: +        return 0 +    # c=n!/(r!*(n-r)!) +    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) + -l = [] -t = 1 -for i in range(N): -    l.append(t) -    t += 2 -t = 2 -for i in range(M): -    l.append(t) -    t += 2 -count = 0 -for v in itertools.combinations(l, 2): -    # print(v[0],v[1]) -    if (v[0] + v[1]) % 2 == 0: -        count += 1 -print(count) +print((combinations_count(N, 2) + combinations_count(M, 2)))