H,W = map(int,input().split()) ans = H * (H+1)//2*W*(W-1) + H * (3*W -W*W-1)-W print(ans)