let n = Scanf.scanf " %d" (+) 0
let a_s = Array.init n @@ fun _ -> Scanf.scanf " %d" (+) 0
let f ans j =
  let s, c = ref 0, ref 0 in
  for i = 0 to n - 1 do
    s := !s + a_s.(i);
    if i mod 2 = j then (if !s <= 0 then (c := !c + 1 - !s; s := 1))
    else (if !s >= 0 then (c := !c + !s + 1; s := -1)) done;
  min ans !c
let _ = List.fold_left f max_int [0; 1] |> Printf.printf "%d\n"