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

int main() {
  cin.tie(0); ios::sync_with_stdio(false);

  int n;
  cin >> n;
  int a[100000];
  rep(i, n) cin >> a[i];

  ll ans = 1LL<<62;
  ll sum[100001] = {};

  // parity
  rep(p, 2) {
    ll cnt = 0;
    rep(i, n) {
      int border = 1+(p+i)%2*-2;
      sum[i+1] = sum[i] + a[i];
      if (border == 1 && sum[i+1] >= border) continue;
      if (border == -1 && sum[i+1] <= border) continue;
      cnt += abs(border-sum[i+1]);
      sum[i+1] = border;
    }
    ans = min(ans, cnt);
  }

  cout << ans << endl;
}
