from functools import lru_cache
h, w = map(int, input().split())
s = 0

while h >1 or w>1:

    s+=h*w
    mn = min(h,w)
    s+= (mn ** 2 + mn) // 2 + mn - 1

    h,w = max(h,w)-1, min(h,w)

print(s+1)
