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