import java.io.InputStreamReader
import java.io.BufferedReader

fun main(args: Array<String>) {
  val br = BufferedReader(InputStreamReader(System.`in`))

  br.readLine()
  val a = br.readLine().split(" ").map { it.toLong() }
    .toLongArray()

  fun solve(init: Int): Long {
    return a.foldIndexed(Pair(0L,0L)) { i, acc, e ->
      val v = acc.second + e
      // println("${i}: ${acc}, ${v}")
      if(i % 2 == init) {
        if(v > 0) Pair(acc.first, v)
        else Pair(acc.first - v + 1L, 1L)
      }
      else {
        if(v < 0) Pair(acc.first, v)
        else Pair(acc.first + v + 1L, -1L)
      }
    }.first
  }

  val ans = Math.min(solve(0), solve(1))
  println(ans)
}