fun main(args: Array<String>) {
    val N = nextInt()
    val A = listOfLong().toLongArray()
    fun solve(init: Int): Long =
        A.foldIndexed(Pair(0L, 0L)) { index, acc, value ->
            val sum = acc.second + value
            if(index % 2 == init) {
                if(sum > 0) Pair(acc.first, sum)
                else Pair(acc.first - sum + 1L, 1L)
            }
            else {
                if(sum < 0) Pair(acc.first, sum)
                else Pair(acc.first + sum + 1L, -1L)
            }
        }.first
    val ans = Math.min(solve(0), solve(1))
    println(ans)
}

fun next() = readLine()!!
fun nextInt(delta: Int = 0) = Integer.parseInt(next()) + delta
fun listOfString() = next().split(" ")
fun listOfLong() = listOfString().map(String::toLong)
