import scala.io.StdIn
import scala.annotation.tailrec

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

  val ans1 = a.tail./:(a.head,0)((acc,i) => {
    val (bsum, bcnt) = acc
    val sum = bsum + i
    val cnt = if(bsum < 0 && sum < 0) 1 - sum
    else if(bsum >= 0 && sum >= 0) -1 - sum
    else if(sum == 0) if(bsum < 0) 1 else -1
    else 0
    println(sum + " " + cnt)
    (sum+cnt, bcnt+cnt.abs)
  })._2

  val ans2 = a.tail./:(-a.head,a.head.abs+1)((acc,i) => {
    val (bsum, bcnt) = acc
    val sum = bsum + i
    val cnt = if(bsum < 0 && sum < 0) 1 - sum
    else if(bsum >= 0 && sum >= 0) -1 - sum
    else if(sum == 0) if(bsum < 0) 1 else -1
    else 0
    println(sum + " " + cnt)
    (sum+cnt, bcnt+cnt.abs)
  })._2

  println(math.min(ans1,ans2))
}