let () = Scanf.scanf "%d %d" @@ fun n l ->
  let abs_ary = Array.init n @@ fun i -> abs (l + i) in
  let all = n * (l - 1) + (n * (n + 1) / 2) in
  let () = Array.sort compare abs_ary in
  let ans = all - abs_ary.(0) in
  Printf.printf "%d\n" ans
