import std.stdio, std.string, std.array, std.conv, std.algorithm, std.typecons, std.range, std.container, std.math, std.algorithm.searching, std.functional,std.mathspecial;

void main(){
    auto n=readln.chomp.to!int;
    auto as=readln.split.map!(to!long).array;

    long fromNega;
    long fromPosi;
    long currentNega;
    long currentPosi;
    foreach(i,a;as){
        currentNega+=a;
        currentPosi+=a;
        if(i%2){
            if(currentNega>=0){
                fromNega+=currentNega+1;
                currentNega=-1;
            }
            if(currentPosi<=0){
                fromPosi+=-currentPosi+1;
                currentPosi=+1;
            }
        }else{
            if(currentNega<=0){
                fromNega+=-currentNega+1;
                currentNega=+1;
            }
            if(currentPosi>=0){
                fromPosi+=currentPosi+1;
                currentPosi=-1;
            }
        }
    }
    writeln(min(fromNega,fromPosi));
}
