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

int main(){
  int N;
  cin >> N;
  vector<long> a(N);
  for(int i=0; i<N; i++){
    cin >> a.at(i);
  }
  
  long sump=0,sumn=0,p=0,n=0;
  
  for(int i=0; i<N; i++){
    sump+=a.at(i);
    if(i%2==0&&sump<=0){
      p+=1-sump;
      sump=1;
    }
    if(i%2==1&&sump>=0){
      p+=1+sump;
      sump=-1;
    }
  }
  for(int i=0; i<N; i++){
    sumn+=a.at(i);
    if(i%2==0&&sumn>=0){
      n+=1+sumn;
      sumn=-1;
    }
    if(i%2==1&&sumn<=0){
      n+=1-sumn;
      sumn=1;
    }
  }
  
  cout << min(p,n) << endl;
}