fun main(args: Array<String>) {
    val n= readLine()!!.toInt()
    var a = readLine()!!.split(" ").map{it.toInt()}


    //先頭がプラス
    var move1=0L
    var sum1=0L
    for(i in 0..n-1){
        sum1+=a[i]
        if(i%2==0 && sum1<1){
            move1 += 1-sum1
            sum1 = 1
        }
        if(i%2==1 && sum1>-1){
            move1 += sum1-(-1)
            sum1 = -1
        }
    }

    //先頭がマイナス
    var move2=0L
    var sum2=0L
    for(i in 0..n-1){
        sum2+=a[i]
        if(i%2==1 && sum2<1){
            move2 += 1-sum2
            sum2 = 1
        }
        if(i%2==0 && sum2>-1){
            move2 += sum2-(-1)
            sum2 = -1
        }
    }


    println(Math.min(move1,move2))

}