n1 = int(input())
n2 = int(input())
ans = 0
max_side = (n1 + 2 * n2) // 4
for a in range(max_side - 1, max_side + 1):
    if n1 < 2 * (a % 2):
        continue
    b = (n1 + 2 * n2 - 2 * a) // 2
    if n1 < 2 * (a % 2 + b % 2):
        b -= 1
    ans = max(ans, a * b)
print(ans)
