# スペース区切りの整数の入力
n,l=gets.chomp.split(" ").map(&:to_i);

taste = 0
#本来できるはずだった味の計算
for i in 0..n-1
    taste += l + i
end


min_diff = 99999
min_diff_taste= 0

for i in 0..n-1
    taste2 = 0
    for j in 0..n-1
        if i!=j
            taste2 += l + j
        end
    end
    if (taste - taste2).abs < min_diff
        min_diff_taste = taste2
        min_diff = (taste - taste2).abs
    end
end

# 出力
print("#{min_diff_taste}\n")
