def abc(a, b, memo={}):
    if (a, b) in memo:
        return memo[(a, b)]
    
    if a == 1 and b == 1:
        result = 1
    elif a + b == 3:
        result = 4
    else:
        result = abc(max(a, b) - 1, min(a, b), memo) + a * b + abc(1, min(a, b), memo)
    
    memo[(a, b)] = result
    return result

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