#include <stdio.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <time.h>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <string.h>

#define sf scanf
#define pf printf
#define lf double
#define ll long long
#define p123 printf("123\n");
#define pn printf("\n");
#define pk printf(" ");
#define p(n) printf("%d",n);
#define pln(n) printf("%d\n",n);
#define s(n) scanf("%d",&n);
#define ss(n) scanf("%s",n);
#define ps(n) printf("%s",n);
#define sld(n) scanf("%lld",&n);
#define pld(n) printf("%lld",n);
#define slf(n) scanf("%lf",&n);
#define plf(n) printf("%lf",n);
#define sc(n) scanf("%c",&n);
#define pc(n) printf("%c",n);
#define gc getchar();
#define re(n,a) memset(n,a,sizeof(n));
#define len(a) strlen(a)
using namespace std;

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <time.h>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <string.h>

#define sf scanf
#define pf printf
#define lf double
#define ll long long
#define p123 printf("123\n");
#define pn printf("\n");
#define pk printf(" ");
#define p(n) printf("%d",n);
#define pln(n) printf("%d\n",n);
#define s(n) scanf("%d",&n);
#define ss(n) scanf("%s",n);
#define ps(n) printf("%s",n);
#define sld(n) scanf("%lld",&n);
#define pld(n) printf("%lld",n);
#define slf(n) scanf("%lf",&n);
#define plf(n) printf("%lf",n);
#define sc(n) scanf("%c",&n);
#define pc(n) printf("%c",n);
#define gc getchar();
#define re(n,a) memset(n,a,sizeof(n));
#define len(a) strlen(a)
using namespace std;


/*
//快速幂 (a^b)%mod
//如果求逆元，则b = mod-2;
ll mod;
//
//快速幂 (a^b)%mod
//如果求逆元，则b = mod-2;
ll pow_quick(ll a,ll b){
    ll r = 1,base = a;
    while(b){
        if(b & 1){
            r *= base;
            r %= mod;
        }
        base *= base;
        base %= mod;
        b >>= 1;
    }
    return r;
}
//
struct A{
    ll op,x;
}a[100060];
int main(){
    int T = 0;
    s(T)
    ll q,m;
    for(ll i = 0; i< T; i ++) {
        //slf(ax) slf(ay) slf(bx) slf(by) slf(cx) slf(cy)
        sld(q) sld(mod)
        ll temp = 1;
        pf("Case #%d: ",i+1);
        for(ll j = 1;j <= q; j ++){
            sld(a[j].op) sld(a[j].x)
            if(a[j].op == 1){
                temp *= a[j].x;
                temp %=
                mod;
            }else if(a[j].op == 2){
                temp *= pow_quick(a[a[j].x].x,mod-2);
                temp %= mod;
            }
            pld(temp) pn
        }






        pn
    }

    return 0;
}
*/
//快速幂 (a^b)%mod
//如果求逆元，则b = mod-2;
//ll a[100000];
ll a[100005];
ll b[100005];
int main() {
    ll n;
    sld(n)
    int flag = 0;
    for(ll i = 1; i <= n; i ++){
        sld(a[i])
        b[i] = a[i];
    }
    flag = 1;
    ll sum = 0;
    ll count0 = 0;
    for(ll i = 1; i <= n; i ++){
        sum += a[i];
        if(flag == 1 && sum <= 0){
            count0 += 1ll+sum*-1;
            sum = 1;
        }else if(flag == -1 && sum >= 0){
            count0 += sum+1ll;
            sum = -1;
        }
        flag *= -1;
    }
    sum = 0;
    flag = -1;
    ll count1 = 0;
    for(ll i = 1; i <= n; i ++){
        sum += a[i];
        if(flag == 1 && sum <= 0){
            count1 += 1ll+sum*-1;
            sum = 1;
        }else if(flag == -1 && sum >= 0){
            count1 += sum+1ll;
            sum = -1;
        }
        flag *= -1;
    }
    pld(min(count0,count1)) pn
    /*ll n,m,k;
    while(~scanf("%lld",&n)){
        sld(m) sld(k)
        if(k & 1){
            k --;
        }
        if(k >= n+m+n+m){
            k = n+m+n+m;
        }
        ll sum = 0;
        //保证n<m
        if(m < n){
            swap(n,m);
        }
        //pld(sum) pn

        for(ll i = 1; i <= k/2-m; i ++){
            ll x = k/2-i;
            sum += (n-i+1)*(x*m+x-(x+1)*x/2);
        }
        pld(sum) pn
    }*/
    return 0;
}


Measured memory_bytes: 1792