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

aji = 0
abs = nil
0.upto(n - 1) do |i|
  aji += l + i
end

ans = nil
0.upto(n - 1) do |i|
  a = 0
  0.upto(n - 1) do |j|
    a += l + j if i != j
  end

  if abs.nil? || (aji - a).abs < abs
    abs = (aji - a).abs
    ans = a
  end
end

puts ans
