n, l = gets.split(" ").map(&:to_i)
aps = Array.new
min = 0
count=0
for k in 1..n
  aps << k + l - 1
  count+=1
  if count >= 2
    if aps[count-1].abs <=  aps[count-2].abs
      min = count-1
    end
  end
end
##p min
aps.delete_at(min)
p aps.inject(:+)