N, K = gets.split.map(&:to_i) puts (2*N-K+1)*K/2 + 1