apples, base = gets.split.map(&:to_i)

res = 0

if base < 0
  if 0 <= base + apples - 1
    res = 0 
  else
    res = base + apples - 1
  end
else
  res = base
end

puts (base + (base + apples - 1)) * apples / 2 - res