#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
int main(void) {
  int n;
  cin >> n;
  ll sum1 = 0, sum2 = 0, ans1 = 0, ans2 = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    sum1 += a;
    sum2 += a;
    if (i % 2 == 0) {
      if (sum1 <= 0) {
        ans1 += (1 - sum1);
        sum1 = 1;
      }
      if (sum2 >= 0) {
        ans2 += (sum2 + 1);
        sum2 = -1;
      }
    } else {
      if (sum2 <= 0) {
        ans2 += (1 - sum2);
        sum2 = 1;
      }
      if (sum1 >= 0) {
        ans1 += (sum1 + 1);
        sum1 = -1;
      }
    }
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}