void main()
{
    long n = readln.chomp.to!long;
    long[] a = readln.split.to!(long[]);

    long psum, msum;
    long pcnt, mcnt;
    foreach (i; 0 .. n)
    {
        psum = psum + a[i];
        msum = msum + a[i];

        if (i & 1)
        {
            if (psum >= 0)
            {
                pcnt += psum + 1;
                psum = -1;
            }
            if (msum <= 0)
            {
                mcnt += msum.abs + 1;
                msum = 1;
            }
        }
        else
        {
            if (psum <= 0)
            {
                pcnt += psum.abs + 1;
                psum = 1;
            }
            if (msum >= 0)
            {
                mcnt += msum + 1;
                msum = -1;
            }
        }
    }

    min(pcnt, mcnt).writeln;
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;