#include <cstdio>
#include <algorithm>

#define maxn 100000
#define ll long long

int a[maxn];

ll det(int n, int a[], int l) {
    int sum = 0;
    ll rez = 0;
    for (int i = 1; i <= n; i++, l = 1 - l) {
        sum += a[i];
        if (l == 0 && sum <= 0) {
            rez += 1 - sum;
            sum = 1;
        }
        else if (l == 1 && sum >= 0) {
            rez += 1 + sum;
            sum = -1;
        }
    }
    return rez;
}

int main() {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
        scanf("%d", &a[i]);
    ll c1 = det(n, a, 0);
    ll c2 = det(n, a, 1);
    ll rez = std::min(c1, c2);
    printf("%lld", rez);
    return 0;
}
