H, W = map(int,input().split()) if H == 0: print(0) exit(0) W = abs(W) t = W//H q = W%H if q == 0: ans = (t*H*(H+1))//2 else: ans = (t*H*(H+1))//2 + H-q + (q*(q+1))//2 print(ans)