import scala.io.{StdIn => in}

object Main extends App {
  val n = in.readInt
  val a = in.readLine.split(" ").map(_.toLong)

  def solve(isEven: Boolean) = {
    val even_odd = if(isEven) 0 else 1
    a./:((0L, 0L, 0)) { (acc, e) =>
      val (count, sum, i) = acc
      val v = sum + e
      if(i % 2 == even_odd) {
        if(v > 0) (count, v, i+1)
        else (count + v.abs + 1L, 1, i+1)
      }
      else {
        if(v < 0) (count, v, i+1)
        else (count + v.abs + 1L, -1, i+1)
      }
    }._1
  }

  val ans = solve(true) min solve(false)
  println(ans)
}