n, l = gets.chomp.split(' ').map(&:to_i)
arr = []
n.times do |i|
  arr << l + i
end

n.times do |i|
  if arr.include?(i)
    print(arr.reduce(:+) - i)
    exit
  end
  if arr.include?(-i)
    print(arr.reduce(:+) + i)
    exit
  end
end
