n, l = gets.split.map(&:to_i)


absdif = 1000000000
taste = 0

orig = 0
n.times do |i|
  orig += l + i
end

n.times do |donteat|
  sum = 0
  n.times do |i|
    sum += l + i if i != donteat
  end

  if absdif > (orig - sum).abs
    taste = sum
    absdif = (orig - sum).abs
  end
end

p taste
