h, w = input().split(' ')
h = int(h)
w = int(w)

out = 0
while(h and w):
    out += h*w
    out += + min(h, w) + ((min(h, w)+2)*(min(h, w)-1)/2)
    if h == max(h, w):
        h -= 1
    else:
        w -= 1

print(int(out - 1))
