let n, l = Scanf.scanf " %d %d" @@ fun a b -> a, b
let sum = n * (2 * l + n - 1) / 2
let _ =
  Array.init n (fun i -> l + i) |> Array.fold_left (fun m v -> if abs v < abs m then v else m) max_int
  |> (-) sum |> Printf.printf "%d\n"