#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <math.h>
#define MOD 1000000007
typedef long long ll;
using namespace std;

int main(){
  int n;
  cin>>n;
  ll a[n];

  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  ll ans1=0,ans2=0;
  ll s=0;
  for(int i=0;i<n;i++){
    s+=a[i];
    if(i%2==0&&s<=0){
      ans1+=1-s;
      s=1ll;
    }else if(i%2==1&&s>=0){
      ans1+=s+1;
      s=-1ll;
    }
  }
  s=0;
  for(int i=0;i<n;i++){
    s+=a[i];
    if(i%2==1&&s<=0){
      ans2+=1-s;
      s=1ll;
    }else if(i%2==0&&s>=0){
      ans2+=s+1;
      s=-1ll;
    }
  }
  cout<<min(ans1,ans2)<<endl;
  return 0;
}
