#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
	ios::sync_with_stdio(false); cin.tie(0);
	int n;
	cin >> n;
	long long ans[2] = {};
	long long sum[2] = {};
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		for (int j = 0; j < 2; j++) {
			sum[j] += x;
			if (j % 2 == i % 2) {
				if (sum[j] <= 0) {
					ans[j] += 1 + abs(sum[j]);
					sum[j] = 1;
				}
			} else {
				if (sum[j] >= 0) {
					ans[j] += 1 + abs(sum[j]);
					sum[j] = -1;
				}
			}
		}
	}
	cout << min(ans[0], ans[1]) << endl;
	return 0;	
}