res = 0

def f(h, w, ans):
   # print(h,w,ans)
    global res
    if h == 1:
        res += (ans + ((h * w) ))
        #print(res)
        return
    ans += (h * w)
    if h % 2 == 0:
        f(h // 2, w, ans)
        f(h // 2, w, ans)
    else:
        f((h // 2) + 1, w, ans)
        f((h // 2), w, ans)

h, w = sorted(map(int, input().split()),reverse=True)
s = h * w
if w==1:
	res=s*2
else:
	k = f(h, w, 0)
print(res)
