#include<iostream>
#include <algorithm>
#include <string>
using namespace std;

int main()
{int N;
 int C[200000];
 cin >> N;
 for(int i=0; i<N; i++){
   cin >> C[i];}
 long long cnt_a=0;
 long long cnt_b=0;
 int sum_a=0;
 int sum_b=0;
 for(int i=0; i<N; i++){
   sum_a += C[i];
   if((i%2==0)&&(sum_a<=0)){
     cnt_a += 1 - sum_a;
     sum_a = 1;}
   if((i%2==1)&&(sum_a>=0)){
     cnt_a += sum_a + 1;
     sum_a = -1;}
 }
  for(int i=0; i<N; i++){
   sum_b += C[i];
   if((i%2==0)&&(sum_b>=0)){
     cnt_b += 1 + sum_b;
     sum_b = -1;}
   if((i%2==1)&&(sum_b<=0)){
     cnt_b += 1 - sum_b;
     sum_b = 1;}
 }
cout << min(cnt_a, cnt_b) << endl;
}

 