#include <bits/stdc++.h>

using namespace std;

typedef long long LL;

const int nmax = 100010; const LL mod = 31007;

int N;
LL a[nmax],ans,s1,s2,s,x;

inline void Solve(){
   int i,j,sgn;
   cin >> N;
   for(i = 1; i <= N; ++i)
      cin >> a[i];
   if(!a[1]){
      sgn=s1=s=1;
      for(i = 2; i <= N; ++i){
         if(sgn>0){
            x = -1-s;
            if(a[i] <= x){s+=a[i];sgn*=-1;continue;}
            s+=x;

            s1+=abs(a[i]-x);
            sgn*=-1;
         }
         else{
               x = 1-s;
               if(a[i] >= x){s+=a[i];sgn*=-1;continue;}
               s+=x;
               s1+=abs(x-a[i]);
               sgn*=-1;
         }
      }
      sgn=a[1]=s=-1;
      s2=1;
      for(i = 2; i <= N; ++i){
         if(sgn>0){
            x = -1-s;
            if(a[i] <= x){s+=a[i];sgn*=-1;continue;}
            s+=x;

            s2+=abs(a[i]-x);
            sgn*=-1;
         }
         else{
               x = 1-s;
               if(a[i] >= x){s+=a[i];sgn*=-1;continue;}
               s+=x;
               s2+=abs(x-a[i]);
               sgn*=-1;
         }
      }
      ans=min(s1,s2);
      cout << ans << '\n';
   }
else{
   if(a[1] > 0){
   s=a[1];
   s2=0;
   sgn=1;
      for(i = 2; i <= N; ++i){
         if(sgn>0){
            x = (s*-1)-1;
            if(a[i] <= x){s+=a[i];sgn*=-1;continue;}
            s+=x;

            s2+=abs(a[i]-x);
            sgn*=-1;
         }
         else{
               x = (s*-1)+1;
               if(a[i] >= x){s+=a[i];sgn*=-1;continue;}
               s+=x;
               s2+=abs(x-a[i]);
               sgn*=-1;
         }
      }
   s=-1;
   s1=a[1]+1;
   sgn=-1;
      for(i = 2; i <= N; ++i){
         if(sgn>0){
            x = (s*-1)-1;
            if(a[i] <= x){s+=a[i];sgn*=-1;continue;}
            s+=x;

            s1+=abs(a[i]-x);
            sgn*=-1;
         }
         else{
               x = (s*-1)+1;
               if(a[i] >= x){s+=a[i];sgn*=-1;continue;}
               s+=x;
               s1+=abs(x-a[i]);
               sgn*=-1;
         }
      }
      cout << min(s1,s2)<<'\n';
      return;
   }




   s=a[1];
   s2=0;
   sgn=-1;
      for(i = 2; i <= N; ++i){
         if(sgn>0){
            x = (s*-1)-1;
            if(a[i] <= x){s+=a[i];sgn*=-1;continue;}
            s+=x;

            s2+=abs(a[i]-x);
            sgn*=-1;
         }
         else{
               x = (s*-1)+1;
               if(a[i] >= x){s+=a[i];sgn*=-1;continue;}
               s+=x;
               s2+=abs(x-a[i]);
               sgn*=-1;
         }
      }
   s=1;
   s1=1-a[1];
   sgn=1;
      for(i = 2; i <= N; ++i){
         if(sgn>0){
            x = (s*-1)-1;
            if(a[i] <= x){s+=a[i];sgn*=-1;continue;}
            s+=x;

            s1+=abs(a[i]-x);
            sgn*=-1;
         }
         else{
               x = (s*-1)+1;
               if(a[i] >= x){s+=a[i];sgn*=-1;continue;}
               s+=x;
               s1+=abs(x-a[i]);
               sgn*=-1;
         }
      }
      cout << min(s1,s2)<<'\n';

}}

inline void Reset(){

}

int main(void){
   int tests;
//   freopen("txt.in","r",stdin);
//   freopen("txt.out","w",stdout);
   ios::sync_with_stdio(false);

   tests=1;
  for(int j = 1; j <= tests; ++j){
      Solve();
      Reset();
  }
    return 0;
}


Measured memory_bytes: 1024