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