h, w = map(int, input().split())
def cnt(h, w):
    s = 0
    e = 1
    k = h
    while True:
        s += (k * e)
        if k == 1: break
        if k % 2 == 1:
            if k != 1:
                k -= 1
                s += e
        else:
            e *= 2
            k //= 2
    return (s * w + h * w)
print(max(cnt(h, w), cnt(w, h)))
