//https://atcoder.jp/contests/abc059/tasks/arc072_a

#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <limits>
#include <stack>
#include <math.h>
#define REP(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define RREP(i,n) for(ll i=(n)-1; i>=0; --i)
#define SREP(i,s,n) for(ll i=(s), i##_len=(n); i<i##_len; ++i)
#define ALL(v) (v).begin(),(v).end()

using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

template <typename T>
T gcd(T a, T b) {
    if(a < b) gcd(b, a);
    if (b == 1) return 1;
    T r;
    while ((r=a%b)) {
        a = b;
        b = r;
    }
    return b;
}

bool comp(pair<ll, ll> a, pair<ll, ll> b) {
    return a.second < b.second;
}

struct UnionFind {
    vector<int> par;
    vector<int> rank;
    
    UnionFind(int n = 1) {
        init(n);
    }
    
    void init(int n = 1) {
        par.resize(n); rank.resize(n);
        for (int i = 0; i < n; ++i) {
            par[i] = i;
            rank[i] = 0;
        }
    }
    
    int root(int x) {
        if (par[x] == x) {
            return x;
        }
        else {
            int r = root(par[x]);
            return par[x] = r;
        }
    }
    
    bool issame(int x, int y) {
        return root(x) == root(y);
    }
    
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y);
        if (rank[x] == rank[y]) ++rank[x];
        par[y] = x;
        return true;
    }
};


#define INF (ll(1e18))

class SegmentTree {
public:
    int N, n;
    vector<ll> value;
    SegmentTree(int n) {
        this->n = n;
        this->N = 1;
        while (N < n) N *= 2;
        this->value = vector<ll>(2 * N - 1, INF);
    }
    
    void update(int i, ll x) {
        i += N - 1;
        value[i] = x;
        while (i > 0) {
            i = (i - 1) / 2;
            value[i] = min(value[i * 2 + 1], value[i * 2 + 2]);
        }
    }
    
    ll query(int l, int r) {
        return _query(l, r, 0, 0, N);
    }
    
    ll _query(int a, int b, int k, int l, int r) {
        if (r <= a || b <= l) return INF;
        if (a <= l && r <= b)
            return value[k];
        else {
            ll c1 = _query(a, b, 2 * k + 1, l, (l + r) / 2);
            ll c2 = _query(a, b, 2 * k + 2, (l + r) / 2, r);
            return min(c1, c2);
        }
    }
};

int msb(ll x) {
    int n = 0;
    while (x > 0) {
        x/=2;
        n++;
    }
    return n;
}

pair<ll, ll> merge(ll a, ll b) {
    ll cnt = 1;
    while (a+b >= 10) {
        ll c = a+b;
        a = c/10;
        b = c%10;
        cnt++;
    }
    return make_pair(a+b, cnt);
}

vector<ll> decomp(ll d, ll c, ll *cost) {
    vector<ll> x;
    if (c % 2 == 1) {
        x.push_back(d);
    }
    
    if (c >= 2) {
        auto r = merge(d, d);
        *cost = *cost + r.second * (c/2);
        auto y = decomp(r.first, c/2, cost);
        x.insert(x.end(), y.begin(), y.end());
    }

    return x;
}

#define MOD (1000000007)

int main(int argc, const char * argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll n;
    cin >> n;
    vector<ll> a(n);
    REP(i, n) {
        cin >> a[i];
    }
    vector<ll> sp(n), sn(n);
    ll p = 0, q = 0;
    if (a[0] > 0) {
        q += a[0]+1;
        sn[0] = -1;
        sp[0] = a[0];
    } else if (a[0] < 0) {
        p += 1-a[0];
        sp[0] = 1;
        sn[0] = a[0];
    } else {
        p = 1;
        q = 1;
        sp[0] = 1;
        sn[0] = -1;
    }
    SREP(i, 1, n) {
        sp[i] = sp[i-1] + a[i];
        if (sp[i] >= 0 && i%2 == 1) {
            p += sp[i]+1;
            sp[i] = -1;
        } else if (sp[i] <= 0 && i%2 == 0) {
            p += 1-sp[i];
            sp[i] = 1;
        }
        sn[i] = sn[i-1] + a[i];
        if (sn[i] >= 0 && i%2 == 0) {
            q += sn[i]+1;
            sn[i] = -1;
        } else if (sn[i] <= 0 && i%2 == 1) {
            q += 1-sn[i];
            sn[i] = 1;
        }
    }
    cout << min(q,p) << endl;
}



Measured memory_bytes: 2560