(* O(n) *)
let n = Scanf.scanf " %d" @@ (+) 0
let a_s = Array.init n @@ fun _ -> Scanf.scanf " %d" @@ (+) 0
let ans = ref max_int
let _ =
  for m = 0 to 1 do
    let sum = ref a_s.(0) in
    let c = ref 0 in
    if !sum >= 0 && m = 0 then (c := abs !sum + 1; sum := -1)
    else if !sum <= 0 && m = 1 then (c := abs !sum + 1; sum := 1);
    for i = 1 to n - 1 do
      sum := !sum + a_s.(i);
      if i mod 2 = m then
        if !sum >= 0 then (c := !c + abs !sum + 1; sum := -1) else ()
      else
        if !sum <= 0 then (c := !c + abs !sum + 1; sum := 1)
    done;
    ans := min !ans !c
  done;
  Printf.printf "%d\n" !ans