//Sequence.cpp (C)
#include <iostream>
using namespace std;

long long ans(int n, int*, int change);

int main(){
  int n;
  int a[110000];
  cin >> n;
  for(int i = 0; i < n; i++) cin >> a[i];
  long long pAns,nAns;
  pAns = ans(n,a,1);
  nAns = ans(n,a,-1);
  printf("%lld\n",min(pAns,nAns));
}

long long ans(int n, int *a, int change){
  long long Ans = 0;
  long long sum = 0;
  for(int i = 0; i < n; i++){
    sum += a[i];
    switch (change) {
      case -1:
      if(sum > -1) Ans += 1 + sum, sum = -1;
      change *= -1;
      break;

      case 1:
      if(sum < 1) Ans += 1 - sum, sum = 1;
      change *= -1;
      break;
    }
  }

  return Ans;
}
