n,k = gets.chomp.split.map(&:to_i) y = n*(n+1)/2 - (n-k)*(n-k+1)/2 puts y+1