h, w = map(int, input().split())
h, w = min(h, w), max(h, w)
c = 0
if h == 1 and w == 1:
    print(1)
elif h == 1:
    print(w * (w + 1) // 2 - 1)
else:
    sh = h * (h + 1) // 2 - 1
    t = w
    while t > 1:
        c += sh
        c += t * h
        t -= 1
    c += sh
    print(c + h * w)