let n = Int(readLine()!)!
let a = readLine()!.characters.split(" ").map{Int(String($0))!}
var ans = [0, 0]
for i in 0..<2 {
    var sum = 0
    for j in 0..<n {
        sum += a[j]
        if j % 2 == i {
            ans[i] += max(1+sum, 0)
            sum = min(sum, -1)
        } else {
            ans[i] += max(1-sum, 0)
            sum = max(sum, 1)
        }
    }
}
print(ans.minElement()!)