//Code by Lucida
#include<bits/stdtr1c++.h>
#define OPEN(x) freopen(x".in","r",stdin),freopen(x".out","w",stdout);
#define foreach(var,con) for(typeof(con.begin()) __ITER__=con.begin(),__END__=con.end();__ITER__!=__END__;++__ITER__)if(bool __FLAG__=1)for(typeof(*__ITER__) &var=*__ITER__;__FLAG__;__FLAG__=0)

typedef long long int64;
typedef long double decimal;
#define NAMESPACE_BEGIN(x) namespace x {
#define NAMESPACE_END }
NAMESPACE_BEGIN(io)
#ifdef OI
const int IN=1e5;
char in[IN],*ip=in,*ie=in;
#define getchar() ( ip==ie && (ie=(ip=in)+fread(in,1,IN,stdin),ip==ie)?EOF:*ip++ )
#endif
struct Istream {
	template <typename T>
	Istream &operator >>(T &);
	template <typename T>
	Istream &operator >>(T *);
}is;
template <typename T>
Istream &Istream::operator >>(T &x) {
	static bool neg;
	static char ch;
	neg=0;
	while(ch=getchar(),ch<'0' || '9'<ch) {
		neg|=ch=='-';
	}
	for(x=0;'0'<=ch && ch<='9';ch=getchar()) {
		(x*=10)+=ch-'0';
	}
	x=neg?-x:x;
	return *this;
}
template <>
Istream &Istream::operator >>(double &x) {
#ifndef OI
	scanf("%lf",&x);
#else
	x=0;throw std::invalid_argument("integer or char required");
#endif
	return *this;
}
template <>
Istream &Istream::operator >>(char &ch) {
	while(ch=getchar(),(ch=='\r' || ch=='\n' || ch==' ' || ch==EOF));
	return *this;
}
template <typename T>
Istream &Istream::operator >>(T *x) {
	char ch;
	while(ch=getchar(),(ch=='\r' || ch=='\n' || ch==' '  || ch==EOF));
	do *x++=ch;
	while(ch=getchar(),(ch!='\r' && ch!='\n' && ch!=' ' && ch!=EOF));
	*x=0;
	return *this;
}

#ifdef OO
const int OUT=1e5;
char out[OUT],*op=out,*oe=out+OUT;
#define flush() fwrite(out,1,op-out,stdout)
#define putchar(x) ( (op==oe?(flush(),op=out,*op++):*op++)=(x) )
#endif
struct Ostream {
#ifndef OO
	char dFormat[20];
	Ostream() {
		sprintf(dFormat,"%%lf");
	}
	void precision(const int &x) {
		sprintf(dFormat,"%%.%dlf",x);
	}
#else
	~Ostream() {
		flush();
	}
#endif
	template <typename T>
	Ostream &operator <<(T x);
	template <typename T>
	Ostream &operator <<(T *x);
}os;
template <typename T>
Ostream &Ostream::operator <<(T x) {
	if(x==0) {
		putchar('0');
	} else {
		if(x<0) {
			putchar('-');
			x=-x;
		}
		static char stack[100];
		static int top;
		for(top=0;x;x/=10) {
			stack[++top]=x%10+'0';
		}
		while(top) {
			putchar(stack[top--]);
		}
	}
	return *this;
}
template <>
Ostream &Ostream::operator <<(double x) {
#ifndef OO
	printf(dFormat,x);
#else
	x=0;throw std::invalid_argument("integer or char required");
#endif
	return *this;
}
template <>
Ostream &Ostream::operator <<(char x) {
	putchar(x);
	return *this;
}
template <typename T>
Ostream &Ostream::operator <<(T *x) {
	while(*x) {
		putchar(*x++);
	}
	return *this;
}
NAMESPACE_END
using io::is;
using io::os;

template <class T> inline bool chkmx(T &a,const T &b) {return a<b?a=b,1:0;}
template <class T> inline bool chkmn(T &a,const T &b) {return b<a?a=b,1:0;}

#define OPERATOR_EXT(type,op) type &operator op##=(type const& a) { return *this=*this op a;}

const int MAXN=1e5+11;
template <class T>
T abs(T const &a) {
	return a<0?-a:a;
}
int64 Run(const int a[],int n) {
	static int64 pref[MAXN];
	pref[1]=a[1];
	int64 res=0;int sgn=a[1]>0?1:-1;
	for(int i=2;i<=n;++i) {
		pref[i]=pref[i-1]+a[i];
		if(sgn*pref[i]>=0) {
			if(sgn==-1) {
				res+=abs(1-pref[i]);
				pref[i]=1;
			} else {
				res+=abs(pref[i]-(-1));
				pref[i]=-1;
			}
		}
		sgn*=-1;
	}
	return res;
}
int main() {
//	freopen("input","r",stdin);
	int n;is>>n;
	static int a[MAXN];
	for(int i=1;i<=n;++i) {
		is>>a[i];
	}
	int64 Ans=LLONG_MAX;
	int a1=a[1];
	a[1]=-1;chkmn(Ans,Run(a,n)+abs(a1-a[1]));
	a[1]=1;chkmn(Ans,Run(a,n)+abs(a1-a[1]));
	if(a1!=0) {
		a[1]=a1;
		chkmn(Ans,Run(a,n)+abs(a1-a[1]));
	}
	os<<Ans<<'\n';
	return 0;
}


Measured memory_bytes: 1408