N = int(eval(input()))

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



ans1 = c = 0

for i,a in enumerate(A):

    c += a

    if i%2:

        if c < 1:

            ans1 += 1-c

            c = 1

    else:

        if c > -1:

            ans1 += c+1

            c = -1



ans2 = c = 0

for i,a in enumerate(A):

    c += a

    if i%2==0:

        if c < 1:

            ans2 += 1-c

            c = 1

    else:

        if c > -1:

            ans2 += c+1

            c = -1



print((min(ans1,ans2)))
N = int(eval(input()))

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



ans1 = 0

s = 0

for i,a in enumerate(A):

    s += a

    if i%2:

        if s > -1:

            ans1 += s+1

            s = -1

    else:

        if s < 1:

            ans1 += 1-s

            s = 1



ans2 = 0

s = 0

for i,a in enumerate(A):

    s += a

    if i%2==0:

        if s > -1:

            ans2 += s+1

            s = -1

    else:

        if s < 1:

            ans2 += 1-s

            s = 1



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

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

-ans1 = c = 0 +ans1 = 0 +s = 0 -    c += a +    s += a -        if c < 1: -            ans1 += 1 - c -            c = 1 +        if s > -1: +            ans1 += s + 1 +            s = -1 -        if c > -1: -            ans1 += c + 1 -            c = -1 -ans2 = c = 0 +        if s < 1: +            ans1 += 1 - s +            s = 1 +ans2 = 0 +s = 0 -    c += a +    s += a -        if c < 1: -            ans2 += 1 - c -            c = 1 +        if s > -1: +            ans2 += s + 1 +            s = -1 -        if c > -1: -            ans2 += c + 1 -            c = -1 +        if s < 1: +            ans2 += 1 - s +            s = 1