type apple_t = {abs_tst:int; id:int}

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