N, L = gets.chomp.split.map(&:to_i)
apples = []
sum = 0
for i in 1..N
  apples.append(L + i - 1)
  sum += L + i - 1
end
s = 100 * 200 + 1
for a in apples
  if s > (sum - (sum - a)).abs
    s = (sum - (sum - a)).abs
    ans = sum - a
  end
end
puts ans
