#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
int A[100005],N;

ll ch(int p)
{
	ll t=0,r=0;
	for(int i=0;i<N;i++,p*=-1)
	{
		t+=A[i];
		if(t*p<=0)
		{
			if(p==-1){r+=abs(-1-t);t=-1;}
			else {r+=abs(1-t);t=1;}
		}
	}
	return r;
}

int main()
{
	scanf("%d",&N);
	for(int i=0;i<N;i++)scanf("%d",&A[i]);
	printf("%lld\n",min(ch(1),ch(-1)));
	return 0;
}