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