fun main(args: Array<String>) {
    readLine()
    val sum = LongArray(2)
    val cost = LongArray(2)
    readLine()!!.split(' ').forEachIndexed { i, astr ->
        val a = astr.toLong()
        sum[0] += a
        sum[1] += a
        if (i % 2 == 0) {
            if (sum[0] <= 0) {
                cost[0] += 1 - sum[0]
                sum[0] = 1
            }
            if (0 <= sum[1]) {
                cost[1] += 1 + sum[1]
                sum[1] = -1
            }
        } else {
            if (0 <= sum[0]) {
                cost[0] += 1 + sum[0]
                sum[0] = -1
            }
            if (sum[1] <= 0) {
                cost[1] += 1 - sum[1]
                sum[1] = 1
            }
        }
    }
    println(cost.min())
}
