#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

ll N;
vector<ll> a;

ll calc(bool sig){
  ll ans = 0LL;
  ll sum = 0LL;

  for(ll i = 0; i < N; i++){
    if(sig ^ (i%2)){
      if(sum + a[i] <= 0){
        ans += 1 - (sum + a[i]); sum = 1;
      }else{
        sum += a[i];
      }
    }else{
      if(sum + a[i] >= 0){
        ans += 1 + (sum + a[i]); sum = -1;
      }else{
        sum += a[i];
      }
    }
  }
  return ans;
}

int main(){
  cin >> N;
  a.resize(N);
  for(ll i = 0; i < N; i++){
    cin >> a[i];
  }
  cout << min(calc(1), calc(0));
}