n, l = gets.chomp.split(' ').map(&:to_i)
before_array = (1..n).to_a
after_array = before_array.map do |item|
  item = item + l - 1
end
after_array.delete(after_array.map(&:abs).min)
# p after_array
p after_array.inject(:+)
