#include <iostream>
#include <vector>
#include <set>
#include <utility>
#include <string>
#include <algorithm>
#include <cmath>

typedef long long ll;
using namespace std;

int a[100005];
int n;

ll calc(int mod)
{
    ll sum = 0, res = 0;
    for (int i = 1; i <= n; i++){
        sum += a[i];
        if (i % 2 == mod && sum <= 0){
            res += (1 - sum);
            sum = 1;
        }
        else if(i % 2 != mod && sum >= 0){
            res += (sum + 1);
            sum = -1;
        }
    }
    return res;
}

int main()
{
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
    }
    cout << min(calc(0), calc(1)) << endl;
    return 0;
}