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



ball_numbers = [2 * i for i in range(N)]

ball_numbers.extend([2 * i + 1 for i in range(M)])



count = 0

for i, num1 in enumerate(ball_numbers):

    for j, num2 in enumerate(ball_numbers):

        if i == j:

            continue

        if (num1 + num2) % 2 == 0:

            count += 1

print((count // 2))
from math import factorial



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



def comb(n, r):

    if n - r < 0:

        return 0

    else:

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



print((comb(N, 2) + comb(M, 2)))
N, M = list(map(int, input().split()))
ball_numbers = [2 * i for i in range(N)]
ball_numbers.extend([2 * i + 1 for i in range(M)])
count = 0
for i, num1 in enumerate(ball_numbers):
    for j, num2 in enumerate(ball_numbers):
        if i == j:
            continue
        if (num1 + num2) % 2 == 0:
            count += 1
print((count // 2))

from math import factorial

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


def comb(n, r):
    if n - r < 0:
        return 0
    else:
        return factorial(n) // (factorial(n - r) * factorial(r))


print((comb(N, 2) + comb(M, 2)))

+from math import factorial + -ball_numbers = [2 * i for i in range(N)] -ball_numbers.extend([2 * i + 1 for i in range(M)]) -count = 0 -for i, num1 in enumerate(ball_numbers): -    for j, num2 in enumerate(ball_numbers): -        if i == j: -            continue -        if (num1 + num2) % 2 == 0: -            count += 1 -print((count // 2)) + + +def comb(n, r): +    if n - r < 0: +        return 0 +    else: +        return factorial(n) // (factorial(n - r) * factorial(r)) + + +print((comb(N, 2) + comb(M, 2)))