#include <bits/stdc++.h>

using namespace std;

int main(){
	int n;
	cin >> n;
	long long int sum1=0,prev1=0;
	long long int sum2=0,prev2=0;
	long long int ans1=0, ans2=0;
	for(int i=0;i<n;i++){
		long long int a;
		cin >> a;
		sum1 += a;
		sum2 += a;
		if(i%2==0){
			if(sum1 >= 0){
				ans1 += abs(sum1)+1;
				sum1 = -1;
			}
			if(sum2 <= 0){
				ans2 += abs(sum2)+1;
				sum2 = 1;
			}
		} else {
			if(sum1 <= 0){
				ans1 += abs(sum1)+1;
				sum1 = 1;
			}
			if(sum2 >= 0){
				ans2 += abs(sum2)+1;
				sum2 = -1;
			}
		}
		prev1 = sum1;
		prev2 = sum2;
	}
	cout << min(ans1, ans2) << endl;
	return 0;
}