#include<iostream>
#include<vector>
#include<cmath>
using namespace std;

int main(void) {
  long n;
  cin >> n;
  long a[n];
  for(int i=0;i<n;++i) {
    cin >> a[i];
  }
  long tmp1=0, tmp2=0;
  long ans1=0, ans2=0;

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