def f(a, b):
    if a == 1 and b == 1:
        return 1
    x = max(a, b)
    y = min(a, b)
    cnt1 = 1
    while cnt1 < x:
        cnt1 *= 2
    cnt1 //= 2


    maxx = max(f(x - cnt1, y) + f(cnt1, y), f(y - cnt1, x) + f(cnt1, x))

    return maxx + a * b


n, m = map(int, input().split())
print(f(n, m))












