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

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

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

