import java.util.Scanner
 
object Main extends App {
  val sc = new Scanner(System.in)
 
  val n = sc.nextInt()
  val a = new Array[Int](n)
  for(i <- 0 until n)
    a(i) = sc.nextInt()
 
  var cnt = 0L
  var ans = 0L
  for(i <- 0 until n){
    val now = a(i)
    cnt += now
 
    if(i % 2 == 0){
      if(cnt < 1){
        ans += 1 - cnt
        cnt = 1
      }
    }
    else{
      if(cnt > -1){
        ans += cnt - (-1)
        cnt = -1
      }
    }
  }
 
  cnt = 0L
  var ans2 = 0L
  for(i <- 0 until n){
    val now = a(i)
    cnt += now
 
    if(i % 2 != 0){
      if(cnt < 1){
        ans2 += 1 - cnt
        cnt = 1
      }
    }
    else{
      if(cnt > -1){
        ans2 += cnt - (-1)
        cnt = -1
      }
    }
  }
 
  println(Math.min(ans, ans2))
}
