object Main extends App {
  import scala.math._
  
  val n = readInt
  val a = readLine.split(" ").map{_.toInt}
  
  //start != 0
  def solve(start:Int):Long = {
    var ans:Long = 0
    var sum:Long = start.toLong
    for (i <- 1 until n) {
      val presum = sum
      sum += a(i)
      if (sum == 0) {
        ans += 1
        sum = -presum/abs(presum)
      } else {
        val check = (presum/abs(presum))*(sum/abs(sum))
        if (check > 0) {
          ans += abs(sum)+1
          sum = -sum/abs(sum)
        }
      }
    }
    ans
  }
  
  if (a(0) == 0) println(min(solve(1),solve(-1))+1)
  else println(min(solve(a(0)),solve(-a(0)/abs(a(0)))+abs(a(0))+1))

}