/*
    AUTHOR:hruday pabbisetty
    NIT ROURKElA
*/
#include <bits/stdc++.h>
using namespace std;
#define opt ios_base::sync_with_stdio(0)
#define lli long long int
#define ulli unsigned long long int
#define I int
#define S string
#define D double
#define rep(i,a,b) for(i=a;i<b;i++)
#define repr(i,a,b) for(i=a;i>b;i--)
#define in(n) scanf("%lld",&n)
#define in2(a,b) scanf("%lld %lld",&a,&b)
#define in3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)
#define out(n) printf("%lld",n)
#define inu(a) scanf("%lld",&a)
#define outu(a) printf("%llu",a)
#define ins(s) scanf("%s",&s)
#define outs(s) printf("%s",s)
#define nl printf("\n")
#define mod 1000000007
#define inf 100000000000000
typedef long long       ll;
typedef pair<lli, lli>  plli;
typedef vector<lli>     vlli;
typedef vector<ulli>    vulli;
typedef vector<ll>      vll;
typedef vector<string>  vs;
typedef vector<plli>     vplli;
#define MM(a,x)  memset(a,x,sizeof(a));
#define ALL(x)   (x).begin(), (x).end()
#define P(x)       cerr<<"{"#x<<" = "<<(x)<<"}"<<endl;
#define P2(x,y)       cerr<<"{"#x" = "<<(x)<<", "#y" = "<<(y)<<"}"<<endl;
#define P3(x,y,z)  cerr<<"{"#x" = "<<(x)<<", "#y" = "<<(y)<<", "#z" = "<<(z)<<"}"<<endl;
#define P4(x,y,z,w)cerr<<"{"#x" = "<<(x)<<", "#y" = "<<(y)<<", "#z" = "<<(z)<<", "#w" = "<<(w)<<"}"<<endl;
#define PP(x,i)     cerr<<"{"#x"["<<i<<"] = "<<x[i]<<"}"<<endl;
#define TM(a,b)     cerr<<"{"#a" -> "#b": "<<1000*(b-a)/CLOCKS_PER_SEC<<"ms}\n";
#define UN(v)    sort(ALL(v)), v.resize(unique(ALL(v))-v.begin())
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define sz() size()
lli power(lli a,lli b)
    {
    lli value;
    if(b==0)
        {
        return 1;
    }
    else if(b%2==0)
        {
        value=power(a,b/2)%mod;
        return(value*value)%mod;
    }
    else
        {
        value=power(a,b/2)%mod;
        return ((a*value)%mod*(value))%mod;
    }
}
int main()
{
    opt;
    lli n;
    cin>>n;
    lli i,cnt=0,sum=0,a[n],cnt1=0,b[n],c[n],d[n],cnt2=0,cnt3=0,e[n],f[n],g[n];
    vlli v;
    rep(i,0,n)
    {
        cin>>a[i];
        b[i]=a[i];
        c[i]=a[i];
        d[i]=a[i];
        e[i]=a[i];
        f[i]=a[i];
        g[i]=a[i];
    }
    if(a[0]==0)
    {
        sum=1;
        b[0]=1;
        cnt=1;
        rep(i,1,n)
        {
        if(sum<0)
        {
            if((sum+b[i])>0)
            {
            }
            else
            {
                lli temp=1-b[i]-sum;
                cnt+=temp;
                b[i]+=temp;
            }
        }
        else
        {
            if((sum+b[i])<0)
            {

            }
            else
            {
                lli temp=-1-b[i]-sum;
                cnt+=abs(temp);
                b[i]+=temp;
            }
        }
        sum+=b[i];
    }

        cnt1=cnt;

        sum=-1;
        c[0]=-1;
        cnt=1;
        rep(i,1,n)
        {
        if(sum<0)
        {
            if((sum+c[i])>0)
            {
            }
            else
            {
                lli temp=1-c[i]-sum;
                cnt+=temp;
                c[i]+=temp;
            }
        }
        else
        {
            if((sum+c[i])<0)
            {

            }
            else
            {
                lli temp=-1-c[i]-sum;
                cnt+=abs(temp);
                c[i]+=temp;
            }
        }
        sum+=c[i];
    }

        v.pb(cnt);
        v.pb(cnt1);
        cout<<min(cnt,cnt1);
        exit(0);
    }
    sum=a[0];
    rep(i,1,n)
    {
        if(sum<0)
        {
            if((sum+a[i])>0)
            {
            }
            else
            {
                lli temp=1-a[i]-sum;
                cnt+=temp;
                a[i]+=temp;
            }
        }
        else
        {
            if((sum+a[i])<0)
            {

            }
            else
            {
                lli temp=-1-a[i]-sum;
                cnt+=abs(temp);
                a[i]+=temp;
            }
        }
        sum+=a[i];
    }
        v.pb(cnt);
        cnt=0;
        if(d[0]>0)
        {

    sum=-1;
    cnt+=(1+d[0]);
    d[0]=-1;
    rep(i,1,n)
    {
        if(sum<0)
        {
            if((sum+d[i])>0)
            {
            }
            else
            {
                lli temp=1-d[i]-sum;
                cnt+=temp;
                d[i]+=temp;
            }
        }
        else
        {
            if((sum+d[i])<0)
            {

            }
            else
            {
                lli temp=-1-d[i]-sum;
                cnt+=abs(temp);
                d[i]+=temp;
            }
        }
        sum+=d[i];
    }
    v.pb(cnt);
        }
        else
        {

    sum=1;
    cnt=0;
    cnt+=(1-e[0]);
    e[0]=1;
    rep(i,1,n)
    {
        if(sum<0)
        {
            if((sum+e[i])>0)
            {
            }
            else
            {
                lli temp=1-e[i]-sum;
                cnt+=temp;
                e[i]+=temp;
            }
        }
        else
        {
            if((sum+e[i])<0)
            {

            }
            else
            {
                lli temp=-1-e[i]-sum;
                cnt+=abs(temp);
                e[i]+=temp;
            }
        }
        sum+=e[i];
    }
    v.pb(cnt);
        }
        cout<<*min_element(ALL(v));
        /*reverse(e,e+n);
        reverse(f,f+n);
        reverse(g,g+n);

    if(e[0]==0)
    {
        sum=1;
        f[0]=1;
        cnt=1;
        rep(i,1,n)
        {
        if(sum<0)
        {
            if((sum+f[i])>0)
            {
            }
            else
            {
                lli temp=1-f[i]-sum;
                cnt+=temp;
                f[i]+=temp;
            }
        }
        else
        {
            if((sum+f[i])<0)
            {

            }
            else
            {
                lli temp=-1-f[i]-sum;
                cnt+=abs(temp);
                f[i]+=temp;
            }
        }
        sum+=f[i];
    }

        cnt1=cnt;

        sum=-1;
        g[0]=-1;
        cnt=1;
        rep(i,1,n)
        {
        if(sum<0)
        {
            if((sum+g[i])>0)
            {
            }
            else
            {
                lli temp=1-g[i]-sum;
                cnt+=temp;
                g[i]+=temp;
            }
        }
        else
        {
            if((sum+g[i])<0)
            {

            }
            else
            {
                lli temp=-1-g[i]-sum;
                cnt+=abs(temp);
                g[i]+=temp;
            }
        }
        sum+=g[i];
    }

        v.pb(cnt);
        v.pb(cnt1);
    }
    if(e[0])
    {

    sum=e[0];
    cnt=0;
    rep(i,1,n)
    {
        if(sum<0)
        {
            if((sum+e[i])>0)
            {
            }
            else
            {
                lli temp=1-e[i]-sum;
                cnt+=temp;
                e[i]+=temp;
            }
        }
        else
        {
            if((sum+e[i])<0)
            {

            }
            else
            {
                lli temp=-1-e[i]-sum;
                cnt+=abs(temp);
                e[i]+=temp;
            }
        }
        sum+=e[i];
    }
       // cout<<cnt;
        v.pb(cnt);
    }*/
   // cout<<*min_element(ALL(v));
}



Measured memory_bytes: 5760