object Main {
  def main(args: Array[String]): Unit = {
    solve
  }

  def solve(): Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    sc.nextLine
    val a = sc.nextLine.split(" ").map(_.toInt).toList

    var prevSum = a(0)
    var opeCount = 0

    for (i <- 1 until n) {
      val currSum = prevSum + a(i)

      if (prevSum < 0 && currSum < 0) {
        opeCount += math.abs(currSum) + 1
        prevSum = 1
      } else if (prevSum > 0 && currSum > 0) {
        opeCount += math.abs(currSum) + 1
        prevSum = -1
      } else {
        if (currSum == 0) {
          opeCount += 1
          if (prevSum < 0) {
            prevSum = 1
          } else {
            prevSum = -1
          }
        } else {
          prevSum = prevSum + a(i)
        }
      }
    }

    println(opeCount)
  }

}
