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