#include<iostream>
#include<vector>
using namespace std;
int main(){
	int n;
	cin >> n;
	vector<long long> a(n+1,0);
	for(int i=1;i<=n;i++){
		cin >> a[i];
		a[i]+=a[i-1];
	}
	long long ans=1LL<<50;
	for(int k=-1;k<=1;k+=2){
		int sign=k;
		long long plus=0,minus=0;
		for(int i=1;i<=n;i++){
			if(a[i]+plus-minus>0){
				if(sign==-1) minus+=a[i]+plus-minus+1;
			}else if(a[i]+plus-minus<0){
				if(sign==1)	plus+=-(a[i]+plus-minus)+1;
			}else{
				if(sign==-1) minus+=1;
				else if(sign==1) plus+=1;
			}
			sign*=-1;
		}
		if(ans>plus+minus) ans=plus+minus;
	}
	cout << ans << endl;
}
