input = gets.split(" ")
N = input[0].to_i
L = input[1].to_i

def taste(i)
  L + i - 1
end

def sum(arr)
  result = 0
  arr.each do |i|
    result += i
  end
  result
end

tastes = (1..N).map do |v| taste(v) end
pie = sum(tastes)

apple = if sum(tastes) == 0
          tastes.sort[tastes.count -1]
        elsif sum(tastes) < 0
          tastes.max
        else
          tastes.min
        end
puts sum(tastes) - apple
