let ans n a =
  let rec f i b s r =
    if i = n then r
    else
      let x = s + a.(i) in
      if b * x > 0 then f (i + 1) ~-b x r
      else f (i + 1) ~-b b (r + abs x + 1)
  in min (f 0 1 0 0) (f 0 ~-1 0 0)

let () =
  let n = read_int () in
  let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun a -> a)) in
  print_int (ans n a)