#include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll inf=1000000000000000000;
long double pi=3.14159265358979323846L;
double eps=1e-12;
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(int i=n;i>=m;i--)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll Pow(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
ll gya[1000010];
ll kai[1000010];
ll beki(ll n,ll k,ll md){
  ll ret=1;
  ll now=n;
  while(k>0){
    if(k%2==1){
      ret*=now;
      ret%=md;
    }
    now*=now;
    now%=md;
    k/=2;
  }
  return ret;
}
ll gyaku(ll n,ll md){
  return beki(n,md-2,md);
}
int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n;cin>>n;
    ll a[n];
    ll sum=0;
    cin>>a[0];
    ll anss=0;
    if(a[0]<=0){
        sum=1;
        anss=1-a[0];
    }
    else{
        sum=a[0];
    }
        
        rep(i,1,n){
            cin>>a[i];
            sum+=a[i];
            
                if(i%2==1){
                    if(sum>=0){
                        anss+=sum+1;
                        sum=-1;
                    }
                }
                else{
                    if(sum<=0){
                        anss+=1-sum;
                        sum=1;
                    }
                
            }
        }
    ll ansss=0;
    if(a[0]>=0){
        sum=-1;
        ansss=a[0]+1;
    }
    else sum=a[0];
        rep(i,1,n){
            
            sum+=a[i];
            
                if(i%2==0){
                    if(sum>=0){
                        ansss+=sum+1;
                        sum=-1;
                    }
                }
                else{
                    if(sum<=0){
                        ansss+=1-sum;
                        sum=1;
                    }
                
            }
        }
        cout<<min(anss,ansss)<<endl;
        return 0;
    
    /*int r=0;
    if(a[0]<0)r=1;
    ll ans=0;
    sum=a[0];
    rep(i,1,n){
        cin>>a[i];
        sum+=a[i];
        if(r==0){
            if(i%2==1){
                if(sum>=0){
                    ans+=sum+1;
                    sum=-1;
                }
            }
            else{
                if(sum<=0){
                    ans+=1-sum;
                    sum=1;
                }
            }
        }
        else{
            if(i%2==0){
                if(sum>=0){
                    ans+=sum+1;
                    sum=-1;
                }
            }
            else{
                if(sum<=0){
                    ans+=1-sum;
                    sum=1;
                }
            }
        }
    }
    cout<<ans<<endl;*/
}


Measured memory_bytes: 1024