N = int(eval(input()))

src = list(map(int, input().split()))



sum1 = sum2 = src[0]

op1 = op2 = 0

if sum1 < 1:

    op1 += (1 - sum1)

    sum1 = 1

if sum2 > -1:

    op2 += (sum2 + 1)

    sum2 = -1



for i in range(1,N):

    if i%2 == 1:

        if sum1 + src[i] > -1:

            op1 += (sum1 + src[i] + 1)

            sum1 = -1

        else:

            sum1 += src[i]

        if sum2 + src[i] < 1:

            op2 += (1 - sum2 - src[i])

            sum2 = 1

        else:

            sum2 += src[i]

    else:

        if sum2 + src[i] > -1:

            op2 += (sum2 + src[i] + 1)

            sum2 = -1

        else:

            sum2 += src[i]

        if sum1 + src[i] < 1:

            op1 += (1 - sum1 - src[i])

            sum1 = 1

        else:

            sum1 += src[i]



print((min(op1,op2)))

N = int(eval(input()))

src = list(map(int,input().split()))



cum1 = cum2 = 0

ans1 = ans2 = 0

for i,a in enumerate(src):

    cum1 += a

    cum2 += a

    if i%2:

        if cum1 >= 0:

            ans1 += cum1+1

            cum1 = -1

        if cum2 <= 0:

            ans2 += 1-cum2

            cum2 = 1

    else:

        if cum1 <= 0:

            ans1 += 1-cum1

            cum1 = 1

        if cum2 >= 0:

            ans2 += cum2+1

            cum2 = -1



print((min(ans1,ans2)))

N = int(eval(input()))
src = list(map(int, input().split()))
sum1 = sum2 = src[0]
op1 = op2 = 0
if sum1 < 1:
    op1 += 1 - sum1
    sum1 = 1
if sum2 > -1:
    op2 += sum2 + 1
    sum2 = -1
for i in range(1, N):
    if i % 2 == 1:
        if sum1 + src[i] > -1:
            op1 += sum1 + src[i] + 1
            sum1 = -1
        else:
            sum1 += src[i]
        if sum2 + src[i] < 1:
            op2 += 1 - sum2 - src[i]
            sum2 = 1
        else:
            sum2 += src[i]
    else:
        if sum2 + src[i] > -1:
            op2 += sum2 + src[i] + 1
            sum2 = -1
        else:
            sum2 += src[i]
        if sum1 + src[i] < 1:
            op1 += 1 - sum1 - src[i]
            sum1 = 1
        else:
            sum1 += src[i]
print((min(op1, op2)))

N = int(eval(input()))
src = list(map(int, input().split()))
cum1 = cum2 = 0
ans1 = ans2 = 0
for i, a in enumerate(src):
    cum1 += a
    cum2 += a
    if i % 2:
        if cum1 >= 0:
            ans1 += cum1 + 1
            cum1 = -1
        if cum2 <= 0:
            ans2 += 1 - cum2
            cum2 = 1
    else:
        if cum1 <= 0:
            ans1 += 1 - cum1
            cum1 = 1
        if cum2 >= 0:
            ans2 += cum2 + 1
            cum2 = -1
print((min(ans1, ans2)))

-sum1 = sum2 = src[0] -op1 = op2 = 0 -if sum1 < 1: -    op1 += 1 - sum1 -    sum1 = 1 -if sum2 > -1: -    op2 += sum2 + 1 -    sum2 = -1 -for i in range(1, N): -    if i % 2 == 1: -        if sum1 + src[i] > -1: -            op1 += sum1 + src[i] + 1 -            sum1 = -1 -        else: -            sum1 += src[i] -        if sum2 + src[i] < 1: -            op2 += 1 - sum2 - src[i] -            sum2 = 1 -        else: -            sum2 += src[i] +cum1 = cum2 = 0 +ans1 = ans2 = 0 +for i, a in enumerate(src): +    cum1 += a +    cum2 += a +    if i % 2: +        if cum1 >= 0: +            ans1 += cum1 + 1 +            cum1 = -1 +        if cum2 <= 0: +            ans2 += 1 - cum2 +            cum2 = 1 -        if sum2 + src[i] > -1: -            op2 += sum2 + src[i] + 1 -            sum2 = -1 -        else: -            sum2 += src[i] -        if sum1 + src[i] < 1: -            op1 += 1 - sum1 - src[i] -            sum1 = 1 -        else: -            sum1 += src[i] -print((min(op1, op2))) +        if cum1 <= 0: +            ans1 += 1 - cum1 +            cum1 = 1 +        if cum2 >= 0: +            ans2 += cum2 + 1 +            cum2 = -1 +print((min(ans1, ans2)))