#import <stdio.h>
#import <stdlib.h>
#define MIN(a,b) ((a)<(b)?(a):(b))

long calc(long *A, long N, int positive) {
    long s = 0;
    long count = 0;
    
    for (long i=0;i<N;i++){
        s += A[i];
        if(i%2==(positive ? 0 : 1)) {
            if (s<=0) {
                count += 1-s;
                s=1;
            }
        } else {
            if (s>=0) {
                count += s+1;
                s=-1;
            }
        }
    }
    
    return count;
}

int main() {
    long N;
    scanf("%ld", &N);
    long *A = (long*)malloc(N * sizeof(long));
    
    long n;
    long i = 0;
    while (scanf("%ld", &n) != EOF) {
        A[i] = n;
        i++;
    }
    
    printf("%ld", MIN(calc(A,N,1),calc(A,N,0)));
    
    free(A);
    return 0;
}

