n,k=map(int, input().split()) print((2*n-k+1)*k//2+1)