def getans(h,w):
    if h>w:
        h, w = w, h
    if h==1:
        ans=w-1
        ans+=(w+1)*w//2
        return ans
    return h*w + getans(w-1,h)+ getans(1,h)
h,w=map(int,input().split())
print(getans(h,w))



































































































































































































































































































































































