#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)n; i++)
using ll = long long;

int main(){
  int n;
  cin >> n;
  ll a[n];
  rep(i,n) cin >> a[i];
  ll c = 0, d = 0, s = 0, t = 0;
  rep(i,n) {
    s += a[i]; t += a[i];
    if(i % 2 == 0) {
      if(s <= 0) {
        c += 1 - s;
        s = 1;
      } 
      if(t >= 0) {
        d += t + 1;
        t = -1;
      }
    } else {
      if(s >= 0) {
        c += s + 1;
        s = -1;
      }
      if(t <= 0) {
        d += 1 - t;
        t = 1;
      }
    }
  }
  cout << min(c,d) << endl;
  return 0;
}