You are given an integer sequence of length N. The i-th term in the sequence is a_i. In one operation, you can select a term and either increment or decrement it by one.  At least how many operations are necessary to satisfy the following conditions?    * For every i (1≤i≤n), the sum of the terms from the 1-st through i-th term is not zero.   * For every i (1≤i≤n-1), the sign of the sum of the terms from the 1-st through i-th term, is different from the sign of the sum of the terms from the 1-st through (i+1)-th term.
n = int(input())
a = list(map(int, input().split()))
l = len(a)
cnt = 0
a_ = 0
x = -1

for i in range(l):
    a_ += a[i]
    if x == -1:
        if a_ > x:
            cnt += a_ -x
            a_ = -1
    else:
        if a_ < x:
            cnt += x-a_
            
            a_ = 1

    x *= -1

cnt1 = 0

x1 = 1

for i in range(l):
    a_ += a[i]
    if x1 == -1:
        if a_ > x1:
            cnt += a_ -x
            a_ = -1
    else:
        if a_ < x1:
            cnt += x1-a_
            
            a_ = 1

    x1 *= -1

print(min(x, x1))
n = int(input())
a = list(map(int, input().split()))
l = len(a)
cnt = 0
a_ = 0
x = -1

for i in range(l):
    a_ += a[i]
    if x == -1:
        if a_ > x:
            cnt += a_ -x
            a_ = -1
    else:
        if a_ < x:
            cnt += x-a_
            
            a_ = 1

    x *= -1

cnt1 = 0
a_ = 0
x1 = 1

for i in range(l):
    a_ += a[i]
    if x1 == -1:
        if a_ > x1:
            cnt1 += a_ -x1
            a_ = -1
    else:
        if a_ < x1:
            cnt1 += x1-a_
            
            a_ = 1

    x1 *= -1

if cnt >= 0 and cnt1 >=0:
    print(min(cnt, cnt1))
elif cnt < 0:
    print(cnt1)
else:
    print(cnt)