def c_Sequence(N, A):

    total = 0  # 変化量の総量

    tmp1 = 0  # 条件を満たすために今見ている項をどれだけ変化させるか

    for i in range(N):

        total += A[i]

        # 奇数番目を正に、偶数番目を負にする(0-indexedで)

        if i % 2 == 0:

            if total >= 0:

                tmp1 += abs(-1 - total)

                total -= abs(-1 - total)

        else:

            if total <= 0:

                tmp1 += 1 - total

                total += 1 - total



    total = 0

    tmp2 = 0

    for i in range(N):

        total += A[i]

        # 奇数番目を負に、偶数番目を正にする

        if i % 2 == 0:

            if total <= 0:

                tmp2 += 1 - total

                total += 1 - total

        else:

            if total >= 0:

                tmp2 += abs(-1 - total)

                total -= abs(-1 - total)

    ans = min(tmp1, tmp2)

    return ans

N = int(eval(input()))

A = [int(i) for i in input().split()]

print((c_Sequence(N, A)))
def c_sequence():

    N = int(eval(input()))

    A = [int(i) for i in input().split()]



    def solver(sign):

        ret, total = 0, 0

        for a in A:

            total += a

            if sign * total <= 0:

                ret += abs(sign - total)  # 総和がsignになるまでaを変化させる

                total = sign

            sign *= -1

        return ret

    # 1: 奇数番目を正、偶数番目を負にする場合。 -1: その逆

    return min(solver(1), solver(-1))



print((c_sequence()))
def c_Sequence(N, A):
    total = 0  # 変化量の総量
    tmp1 = 0  # 条件を満たすために今見ている項をどれだけ変化させるか
    for i in range(N):
        total += A[i]
        # 奇数番目を正に、偶数番目を負にする(0-indexedで)
        if i % 2 == 0:
            if total >= 0:
                tmp1 += abs(-1 - total)
                total -= abs(-1 - total)
        else:
            if total <= 0:
                tmp1 += 1 - total
                total += 1 - total
    total = 0
    tmp2 = 0
    for i in range(N):
        total += A[i]
        # 奇数番目を負に、偶数番目を正にする
        if i % 2 == 0:
            if total <= 0:
                tmp2 += 1 - total
                total += 1 - total
        else:
            if total >= 0:
                tmp2 += abs(-1 - total)
                total -= abs(-1 - total)
    ans = min(tmp1, tmp2)
    return ans


N = int(eval(input()))
A = [int(i) for i in input().split()]
print((c_Sequence(N, A)))

def c_sequence():
    N = int(eval(input()))
    A = [int(i) for i in input().split()]

    def solver(sign):
        ret, total = 0, 0
        for a in A:
            total += a
            if sign * total <= 0:
                ret += abs(sign - total)  # 総和がsignになるまでaを変化させる
                total = sign
            sign *= -1
        return ret

    # 1: 奇数番目を正、偶数番目を負にする場合。 -1: その逆
    return min(solver(1), solver(-1))


print((c_sequence()))

-def c_Sequence(N, A): -    total = 0  # 変化量の総量 -    tmp1 = 0  # 条件を満たすために今見ている項をどれだけ変化させるか -    for i in range(N): -        total += A[i] -        # 奇数番目を正に、偶数番目を負にする(0-indexedで) -        if i % 2 == 0: -            if total >= 0: -                tmp1 += abs(-1 - total) -                total -= abs(-1 - total) -        else: -            if total <= 0: -                tmp1 += 1 - total -                total += 1 - total -    total = 0 -    tmp2 = 0 -    for i in range(N): -        total += A[i] -        # 奇数番目を負に、偶数番目を正にする -        if i % 2 == 0: -            if total <= 0: -                tmp2 += 1 - total -                total += 1 - total -        else: -            if total >= 0: -                tmp2 += abs(-1 - total) -                total -= abs(-1 - total) -    ans = min(tmp1, tmp2) -    return ans +def c_sequence(): +    N = int(eval(input())) +    A = [int(i) for i in input().split()] + +    def solver(sign): +        ret, total = 0, 0 +        for a in A: +            total += a +            if sign * total <= 0: +                ret += abs(sign - total)  # 総和がsignになるまでaを変化させる +                total = sign +            sign *= -1 +        return ret + +    # 1: 奇数番目を正、偶数番目を負にする場合。 -1: その逆 +    return min(solver(1), solver(-1)) -N = int(eval(input())) -A = [int(i) for i in input().split()] -print((c_Sequence(N, A))) +print((c_sequence()))