N = int(eval(input()))

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



x = 0

tmp = 0

for i in range(N):

    tmp += A[i]

    if i & 1 == 0:

        if tmp < 1:

            x += 1-tmp

            tmp = 1

    else:

        if tmp > -1:

            x += 1+tmp

            tmp = -1

y = 0

tmp = 0

for i in range(N):

    tmp += A[i]

    if i & 1:

        if tmp < 1:

            y += 1-tmp

            tmp = 1

    else:

        if tmp > -1:

            y += 1+tmp

            tmp = -1

print((min(x,y)))
n = int(eval(input()))

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



def check(flag):

    acc = 0

    cnt = 0



    flag = flag

    for i in a:

        acc += i

        if (flag == 1 and flag > acc) or (flag == -1 and flag < acc) or i == 0:

            cnt += abs(flag - acc)

            acc = flag

        flag *= -1

    return cnt



print((min(check(1), check(-1))))



N = int(eval(input()))
A = list(map(int, input().split()))
x = 0
tmp = 0
for i in range(N):
    tmp += A[i]
    if i & 1 == 0:
        if tmp < 1:
            x += 1 - tmp
            tmp = 1
    else:
        if tmp > -1:
            x += 1 + tmp
            tmp = -1
y = 0
tmp = 0
for i in range(N):
    tmp += A[i]
    if i & 1:
        if tmp < 1:
            y += 1 - tmp
            tmp = 1
    else:
        if tmp > -1:
            y += 1 + tmp
            tmp = -1
print((min(x, y)))

n = int(eval(input()))
a = list(map(int, input().split()))


def check(flag):
    acc = 0
    cnt = 0
    flag = flag
    for i in a:
        acc += i
        if (flag == 1 and flag > acc) or (flag == -1 and flag < acc) or i == 0:
            cnt += abs(flag - acc)
            acc = flag
        flag *= -1
    return cnt


print((min(check(1), check(-1))))

-N = int(eval(input())) -A = list(map(int, input().split())) -x = 0 -tmp = 0 -for i in range(N): -    tmp += A[i] -    if i & 1 == 0: -        if tmp < 1: -            x += 1 - tmp -            tmp = 1 -    else: -        if tmp > -1: -            x += 1 + tmp -            tmp = -1 -y = 0 -tmp = 0 -for i in range(N): -    tmp += A[i] -    if i & 1: -        if tmp < 1: -            y += 1 - tmp -            tmp = 1 -    else: -        if tmp > -1: -            y += 1 + tmp -            tmp = -1 -print((min(x, y))) +n = int(eval(input())) +a = list(map(int, input().split())) + + +def check(flag): +    acc = 0 +    cnt = 0 +    flag = flag +    for i in a: +        acc += i +        if (flag == 1 and flag > acc) or (flag == -1 and flag < acc) or i == 0: +            cnt += abs(flag - acc) +            acc = flag +        flag *= -1 +    return cnt + + +print((min(check(1), check(-1))))