#include <iostream>
#include <string>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll s1, s2, c1, c2;
int main() {
	ll n, a[100010];
	cin >> n;
	for (int i = 1; i <= n; i++)cin >> a[i];
	for (int i = 1; i <= n; i++) {
		s1 += a[i];
		s2 += a[i];
		if (i % 2) {
			if (s1 <= 0) {
				c1 += 1 - s1;
				s1 = 1;
			}
			if (s2 >= 0) {
				c2 += 1 + s2;
				s2 = -1;
			}
		}
		else {
			if (s1 >= 0) {
				c1 += 1 + s1;
				s1 = -1;
			}
			if (s2 <= 0) {
				c2 += 1 - s2;
				s2 = 1;
			}
		}
	}
	cout << min(c1, c2) << endl;
	return 0;
}