local n, l = io.read("*n", "*n")
local t = {}
for i = 1, n do
  t[i] = i + l - 1
end
local rm = t[1]
local sum = 0
for i = 1, n do
  sum = sum + t[i]
  if math.abs(t[i]) < math.abs(rm) then
    rm = t[i]
  end
end
print(sum - rm)
