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