def calculate_maximum_carpet_area(h, w):
    if h == w:
        return (h * w) * (h * w + 1) // 2 + 2
    else:
        return (h * w) * (h * w + 1) // 2 + 1


h, w = map(int, input().split())
print(calculate_maximum_carpet_area(h, w))