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
    t = s * w
    s = 0
    e = 1
    k = w
    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
    t += s * h
    return t - h * w
print(max(cnt(w, h), cnt(h, w)))
