n,l = gets.chomp.split(' ').map(&:to_i)
i = 1
s = []
while i <= n
  s << l+i-1
  i += 1
end
max = s.sum # 20
basic = (max-s[0]).abs # 18
i = 0
while i < n
  if (max-(max-s[i])).abs <(max-basic).abs
    basic = max-s[i]
  end
  i += 1
end
p basic