N, L = gets.chomp.split.map(&:to_i)
T = Array.new(N) {|i| L + i}
min = T.map(&:abs).min
sum = 0
eat = false
T.each do |t|
  if !eat && t.abs == min
    eat = true
  else
    sum += t
  end
end
puts sum
