from collections import Counter,defaultdict

import sys,heapq,bisect,math,itertools,string,queue,fractions

mod = 10**9+7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

def inpl_str(): return list(sys.stdin.readline().split())

def lcm(x, y):

    return (x * y) // fractions.gcd(x, y)



n = inp()

a = inpl()

acc = list(itertools.accumulate(a))

#+-+-+-

cnt = 0

tmp = 0

for i in range(n):

    if i%2==0:

        tt = acc[i] + tmp

        if tt <= 0:

            cnt += 1 - tt

            tmp += 1 - tt

    else:

        tt = acc[i] + tmp

        if tt >= 0:

            cnt += tt + 1

            tmp -= tt + 1

ans = cnt

#-+-+-+

cnt = 0

tmp = 0

for i in range(n):

    if i%2:

        tt = acc[i] + tmp

        if tt <= 0:

            cnt += 1 - tt

            tmp += 1 - tt

    else:

        tt = acc[i] + tmp

        if tt >= 0:

            cnt += tt + 1

            tmp -= tt + 1

    # print(i,cnt,tmp,tt)

print((min(ans,cnt)))
from collections import Counter,defaultdict,deque

from heapq import heappop,heappush,heapify

from bisect import bisect_left,bisect_right 

import sys,math,itertools,fractions,pprint

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))



n = inp()

a = inpl()

now = 0

res = INF

cnt = 0

for i in range(n):

    now += a[i]

    if i%2 == 0:

        if now <= 0:

            cnt += 1-now

            now = 1

    else:

        if now >= 0:

            cnt += now+1

            now = -1

    # print(i,now,cnt)

res = min(res,cnt)

now = 0

cnt = 0

for i in range(n):

    now += a[i]

    if i%2:

        if now <= 0:

            cnt += -now + 1

            now = 1

    else:

        if now >= 0:

            cnt += now + 1

            now = -1

    # print(i,now,cnt)    

res = min(res,cnt)

print(res)
from collections import Counter, defaultdict
import sys, heapq, bisect, math, itertools, string, queue, fractions

mod = 10**9 + 7


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


def inpln(n):
    return list(int(sys.stdin.readline()) for i in range(n))


def inpl_str():
    return list(sys.stdin.readline().split())


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


n = inp()
a = inpl()
acc = list(itertools.accumulate(a))
# +-+-+-
cnt = 0
tmp = 0
for i in range(n):
    if i % 2 == 0:
        tt = acc[i] + tmp
        if tt <= 0:
            cnt += 1 - tt
            tmp += 1 - tt
    else:
        tt = acc[i] + tmp
        if tt >= 0:
            cnt += tt + 1
            tmp -= tt + 1
ans = cnt
# -+-+-+
cnt = 0
tmp = 0
for i in range(n):
    if i % 2:
        tt = acc[i] + tmp
        if tt <= 0:
            cnt += 1 - tt
            tmp += 1 - tt
    else:
        tt = acc[i] + tmp
        if tt >= 0:
            cnt += tt + 1
            tmp -= tt + 1
    # print(i,cnt,tmp,tt)
print((min(ans, cnt)))

from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions, pprint

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


n = inp()
a = inpl()
now = 0
res = INF
cnt = 0
for i in range(n):
    now += a[i]
    if i % 2 == 0:
        if now <= 0:
            cnt += 1 - now
            now = 1
    else:
        if now >= 0:
            cnt += now + 1
            now = -1
    # print(i,now,cnt)
res = min(res, cnt)
now = 0
cnt = 0
for i in range(n):
    now += a[i]
    if i % 2:
        if now <= 0:
            cnt += -now + 1
            now = 1
    else:
        if now >= 0:
            cnt += now + 1
            now = -1
    # print(i,now,cnt)
res = min(res, cnt)
print(res)

-from collections import Counter, defaultdict -import sys, heapq, bisect, math, itertools, string, queue, fractions +from collections import Counter, defaultdict, deque +from heapq import heappop, heappush, heapify +from bisect import bisect_left, bisect_right +import sys, math, itertools, fractions, pprint +sys.setrecursionlimit(10**8) +INF = float("inf") -def inpln(n): -    return list(int(sys.stdin.readline()) for i in range(n)) - - -def inpl_str(): -    return list(sys.stdin.readline().split()) - - -def lcm(x, y): -    return (x * y) // fractions.gcd(x, y) - - -acc = list(itertools.accumulate(a)) -# +-+-+- +now = 0 +res = INF -tmp = 0 +    now += a[i] -        tt = acc[i] + tmp -        if tt <= 0: -            cnt += 1 - tt -            tmp += 1 - tt +        if now <= 0: +            cnt += 1 - now +            now = 1 -        tt = acc[i] + tmp -        if tt >= 0: -            cnt += tt + 1 -            tmp -= tt + 1 -ans = cnt -# -+-+-+ +        if now >= 0: +            cnt += now + 1 +            now = -1 +    # print(i,now,cnt) +res = min(res, cnt) +now = 0 -tmp = 0 +    now += a[i] -        tt = acc[i] + tmp -        if tt <= 0: -            cnt += 1 - tt -            tmp += 1 - tt +        if now <= 0: +            cnt += -now + 1 +            now = 1 -        tt = acc[i] + tmp -        if tt >= 0: -            cnt += tt + 1 -            tmp -= tt + 1 -    # print(i,cnt,tmp,tt) -print((min(ans, cnt))) +        if now >= 0: +            cnt += now + 1 +            now = -1 +    # print(i,now,cnt) +res = min(res, cnt) +print(res)