let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (N, L) = (input[0], input[1])
let apples = (0..<N).map{$0+L}
let tmp = L>=0 ? apples[0] : N+L-1<0 ? apples[N-1] : 0
print(apples.reduce(0){$0+$1} - tmp)