object Main extends App {
  val scan = new java.util.Scanner(System.in)
  val n  = scan.next().toInt
  val ns = (1 to n).map(_ => scan.next().toInt)

  var even_sum = 0
  var even_cnt = 0
  for (i <- 0 until n) {
    even_sum += ns(i)
    if (i%2 == 0) {
      if (even_sum == 0) {
        even_sum += 1
        even_cnt += 1
      } else if (even_sum < 0) {
        even_cnt += 1-even_sum
        even_sum = 1
      }
    } else {
      if (even_sum == 0) {
        even_sum -= 1
        even_cnt += 1
      } else if (even_sum > 0) {
        even_cnt += 1+even_sum
        even_sum = -1
      }
    }
  }

  var odd_sum = 0
  var odd_cnt = 0
  for (i <- 0 until n) {
    odd_sum += ns(i)
    if (i%2 != 0) {
      if (odd_sum == 0) {
        odd_sum += 1
        odd_cnt += 1
      } else if (odd_sum < 0) {
        odd_cnt += 1-odd_sum
        odd_sum = 1
      }
    } else {
      if (odd_sum == 0) {
        odd_sum -= 1
        odd_cnt += 1
      } else if (odd_sum > 0) {
        odd_cnt += 1+odd_sum
        odd_sum = -1
      }
    }
  }
  println(math.min(odd_cnt, even_cnt))
}