#include <iostream>
#include <algorithm>
#include <cstdlib>


using namespace std;


long long solver(bool pre_is_posi, long long a[], long long n)
{
  long long total=0, ans=0;

  for (int i=0; i<n; i++){
    total += a[i];
    if (pre_is_posi && total >= 0){
      ans += abs(total)+1;
      total = -1;
    } else if (!(pre_is_posi) && total <= 0){
      ans += abs(total)+1;
      total = 1;
    }
    pre_is_posi = (total > 0);
  }
  return ans;
}


int main()
{
  long long n, a[100000];

  cin >> n;
  for (int i=0; i<n; i++) cin >> a[i];
  cout << min(solver(true, a, n), solver(false, a, n)) << endl;
  
  return 0;
}
