H, W = map(int,input().split()) 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)