#include <bits/stdc++.h>
typedef long long ll;
ll ans,cnt,tmp;
ll z[100005];
int main()
{
//    freopen("in.txt", "r", stdin);
    int n,flag;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
        scanf("%lld", &z[i]);
    if (z[0] > 0)
    {
        flag = 1;
        ans = z[0];
        for (int i = 1; i < n; i++)
        {
            ans += z[i];
            if (flag == 1)
            {
                if (ans >= 0)
                {
                    cnt += ans + 1;
                    ans = -1;
                }
                flag = -1;
            }
            else
            {
                if (ans <= 0)
                {
                    cnt += 1 - ans;
                    ans = 1;
                }
                flag = 1;
            }
        }
        tmp = cnt;
        flag = -1;
        ans = -1;
        cnt =z[0] + 1;
        for (int i = 1; i < n; i++)
        {
            ans += z[i];
            if (flag == 1)
            {
                if (ans >= 0)
                {
                    cnt += ans + 1;
                    ans = -1;
                }
                flag = -1;
            }
            else
            {
                if (ans <= 0)
                {
                    cnt += 1 - ans;
                    ans = 1;
                }
                flag = 1;
            }
        }
        cnt = std::min(cnt, tmp);
    }
    else if (z[0] < 0)
    {
        flag = -1;
        ans = z[0];
        for (int i = 1; i < n; i++)
        {
            ans += z[i];
            if (flag == 1)
            {
                if (ans >= 0)
                {
                    cnt += ans + 1;
                    ans = -1;
                }
                flag = -1;
            }
            else
            {
                if (ans <= 0)
                {
                    cnt += 1 - ans;
                    ans = 1;
                }
                flag = 1;
            }
        }
        tmp = cnt;
        flag = 1;
        ans = 1;
        cnt = 1 - z[0];
        for (int i = 1; i < n; i++)
        {
            ans += z[i];
            if (flag == 1)
            {
                if (ans >= 0)
                {
                    cnt += ans + 1;
                    ans = -1;
                }
                flag = -1;
            }
            else
            {
                if (ans <= 0)
                {
                    cnt += 1 - ans;
                    ans = 1;
                }
                flag = 1;
            }
        }
        cnt = std::min(cnt, tmp);
    }
    else
    {
        flag = cnt = ans = 1;
        for (int i = 1; i < n; i++)
        {
            ans += z[i];
            if (flag == 1)
            {
                if (ans >= 0)
                {
                    cnt += ans + 1;
                    ans = -1;
                }
                flag = -1;
            }
            else
            {
                if (ans <= 0)
                {
                    cnt += 1 - ans;
                    ans = 1;
                }
                flag = 1;
            }
        }
        tmp = cnt;
        flag = ans = -1;
        cnt = 1;
        for (int i = 1; i < n; i++)
        {
            ans += z[i];
            if (flag == 1)
            {
                if (ans >= 0)
                {
                    cnt += ans + 1;
                    ans = -1;
                }
                flag = -1;
            }
            else
            {
                if (ans <= 0)
                {
                    cnt += 1 - ans;
                    ans = 1;
                }
                flag = 1;
            }
        }
        cnt = std::min(cnt, tmp);
    }
    printf("%lld\n", cnt);
    return 0;
}

Measured memory_bytes: 1024