object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val as = List.fill(n)(sc.nextLong())

  def solve(sgn: Int): Long = {
    var sum = 0L
    var ans = 0L
    if (sgn * as.head <= 0) {
      sum = sgn
      ans += as.head + 1
    } else {
      sum = as.head
    }

    for (a <- as.tail) {
      if ((sum > 0 && sum + a >= 0) || (sum < 0 && sum + a <= 0)) {
        ans += (if (sum > 0) sum + a + 1 else -(sum + a - 1))
        sum = if (sum > 0) -1 else 1
      } else {
        sum = sum + a
      }
    }
    ans
  }

  println(solve(1).min(solve(-1)))
}
