#!usr/bin/env python3

from collections import defaultdict

from heapq import heappush, heappop

import sys

import math

import bisect

import random

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

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

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

def S(): return list(sys.stdin.readline())[:-1]

def IR(n):

    l = [None for i in range(n)]

    for i in range(n):l[i] = I()

    return l

def LIR(n):

    l = [None for i in range(n)]

    for i in range(n):l[i] = LI()

    return l

def SR(n):

    l = [None for i in range(n)]

    for i in range(n):l[i] = S()

    return l

def LSR(n):

    l = [None for i in range(n)]

    for i in range(n):l[i] = SR()

    return l

mod = 1000000007



#A



#B



#C

n = I()

a = LI()

b = [a[i] for i in range(n)]

ans = 0

k = a[0]

if a[0] == 0:

    a[0] = 1

    ans = 1

    k = 1

for i in range(1,n):

    if k*(k+a[i]) >= 0:

        if k < 0:

            ans += abs(1-k-a[i])

            a[i] = 1-k

            k = 1

        else:

            ans += abs(-1-k-a[i])

            a[i] = -1-k

            k = -1

    else:

        k += a[i]

if b[0] >= 0:

    ans2 = b[0]+1

    k = -1

    b[0] = -1

else:

    ans2 = 1-b[0]

    k = 1

    b[0] = 1

for i in range(1,n):

    if k*(k+b[i]) >= 0:

        if k < 0:

            ans2 += abs(1-k-b[i])

            b[i] = 1-k

            k = 1

        else:

            ans2 += abs(-1-k-b[i])

            b[i] = -1-k

            k = -1

    else:

        k += b[i]

print((min(ans,ans2)))



#D

"""

x,y = LI()

if abs(x-y) <= 1:

    print("Brown")

else:

    print("Alice")

"""

#E



#F



#G



#H



#I



#J



#K



#L



#M



#N



#O



#P



#Q



#R



#S



#T

#!usr/bin/env python3

from collections import defaultdict,deque

from heapq import heappush, heappop

import sys

import math

import bisect

import random

def LI(): return [int(x) for x in sys.stdin.readline().split()]

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

def LS():return [list(x) for x in sys.stdin.readline().split()]

def S():

    res = list(sys.stdin.readline())

    if res[-1] == "\n":

        return res[:-1]

    return res

def IR(n):

    return [I() for i in range(n)]

def LIR(n):

    return [LI() for i in range(n)]

def SR(n):

    return [S() for i in range(n)]

def LSR(n):

    return [LS() for i in range(n)]



sys.setrecursionlimit(1000000)

mod = 1000000007



def solve():

    n = I()

    a = LI()

    ans = 0

    s = a[0]

    if s <= 0:

        ans += 1-a[0]

        s = 1

    f = 1

    for i in a[1:]:

        s += i

        if f and (s >= 0):

            ans += s+1

            s = -1

        if not f and (s <= 0):

            ans += 1-s

            s = 1

        f ^= 1

    m = ans

    ans = 0

    s = a[0]

    if s >= 0:

        ans += a[0]+1

        s = -1

    f = 0

    for i in a[1:]:

        s += i

        if f and (s >= 0):

            ans += s+1

            s = -1

        if not f and (s <= 0):

            ans += 1-s

            s = 1

        f ^= 1

    print((min(m,ans)))

    return



#Solve

if __name__ == "__main__":

    solve()

#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random


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


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


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


def S():
    return list(sys.stdin.readline())[:-1]


def IR(n):
    l = [None for i in range(n)]
    for i in range(n):
        l[i] = I()
    return l


def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):
        l[i] = LI()
    return l


def SR(n):
    l = [None for i in range(n)]
    for i in range(n):
        l[i] = S()
    return l


def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):
        l[i] = SR()
    return l


mod = 1000000007
# A
# B
# C
n = I()
a = LI()
b = [a[i] for i in range(n)]
ans = 0
k = a[0]
if a[0] == 0:
    a[0] = 1
    ans = 1
    k = 1
for i in range(1, n):
    if k * (k + a[i]) >= 0:
        if k < 0:
            ans += abs(1 - k - a[i])
            a[i] = 1 - k
            k = 1
        else:
            ans += abs(-1 - k - a[i])
            a[i] = -1 - k
            k = -1
    else:
        k += a[i]
if b[0] >= 0:
    ans2 = b[0] + 1
    k = -1
    b[0] = -1
else:
    ans2 = 1 - b[0]
    k = 1
    b[0] = 1
for i in range(1, n):
    if k * (k + b[i]) >= 0:
        if k < 0:
            ans2 += abs(1 - k - b[i])
            b[i] = 1 - k
            k = 1
        else:
            ans2 += abs(-1 - k - b[i])
            b[i] = -1 - k
            k = -1
    else:
        k += b[i]
print((min(ans, ans2)))
# D
"""
x,y = LI()
if abs(x-y) <= 1:
    print("Brown")
else:
    print("Alice")
"""
# E
# F
# G
# H
# I
# J
# K
# L
# M
# N
# O
# P
# Q
# R
# S
# T

#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random


def LI():
    return [int(x) for x in sys.stdin.readline().split()]


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


def LS():
    return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    n = I()
    a = LI()
    ans = 0
    s = a[0]
    if s <= 0:
        ans += 1 - a[0]
        s = 1
    f = 1
    for i in a[1:]:
        s += i
        if f and (s >= 0):
            ans += s + 1
            s = -1
        if not f and (s <= 0):
            ans += 1 - s
            s = 1
        f ^= 1
    m = ans
    ans = 0
    s = a[0]
    if s >= 0:
        ans += a[0] + 1
        s = -1
    f = 0
    for i in a[1:]:
        s += i
        if f and (s >= 0):
            ans += s + 1
            s = -1
        if not f and (s <= 0):
            ans += 1 - s
            s = 1
        f ^= 1
    print((min(m, ans)))
    return


# Solve
if __name__ == "__main__":
    solve()

-from collections import defaultdict +from collections import defaultdict, deque -    return list(map(int, sys.stdin.readline().split())) +    return [int(x) for x in sys.stdin.readline().split()] -    return list(map(list, sys.stdin.readline().split())) +    return [list(x) for x in sys.stdin.readline().split()] -    return list(sys.stdin.readline())[:-1] +    res = list(sys.stdin.readline()) +    if res[-1] == "\n": +        return res[:-1] +    return res -    l = [None for i in range(n)] -    for i in range(n): -        l[i] = I() -    return l +    return [I() for i in range(n)] -    l = [None for i in range(n)] -    for i in range(n): -        l[i] = LI() -    return l +    return [LI() for i in range(n)] -    l = [None for i in range(n)] -    for i in range(n): -        l[i] = S() -    return l +    return [S() for i in range(n)] -    l = [None for i in range(n)] -    for i in range(n): -        l[i] = SR() -    return l +    return [LS() for i in range(n)] +sys.setrecursionlimit(1000000) -# A -# B -# C -n = I() -a = LI() -b = [a[i] for i in range(n)] -ans = 0 -k = a[0] -if a[0] == 0: -    a[0] = 1 -    ans = 1 -    k = 1 -for i in range(1, n): -    if k * (k + a[i]) >= 0: -        if k < 0: -            ans += abs(1 - k - a[i]) -            a[i] = 1 - k -            k = 1 -        else: -            ans += abs(-1 - k - a[i]) -            a[i] = -1 - k -            k = -1 -    else: -        k += a[i] -if b[0] >= 0: -    ans2 = b[0] + 1 -    k = -1 -    b[0] = -1 -else: -    ans2 = 1 - b[0] -    k = 1 -    b[0] = 1 -for i in range(1, n): -    if k * (k + b[i]) >= 0: -        if k < 0: -            ans2 += abs(1 - k - b[i]) -            b[i] = 1 - k -            k = 1 -        else: -            ans2 += abs(-1 - k - b[i]) -            b[i] = -1 - k -            k = -1 -    else: -        k += b[i] -print((min(ans, ans2))) -# D -""" -x,y = LI() -if abs(x-y) <= 1: -    print("Brown") -else: -    print("Alice") -""" -# E -# F -# G -# H -# I -# J -# K -# L -# M -# N -# O -# P -# Q -# R -# S -# T + + +def solve(): +    n = I() +    a = LI() +    ans = 0 +    s = a[0] +    if s <= 0: +        ans += 1 - a[0] +        s = 1 +    f = 1 +    for i in a[1:]: +        s += i +        if f and (s >= 0): +            ans += s + 1 +            s = -1 +        if not f and (s <= 0): +            ans += 1 - s +            s = 1 +        f ^= 1 +    m = ans +    ans = 0 +    s = a[0] +    if s >= 0: +        ans += a[0] + 1 +        s = -1 +    f = 0 +    for i in a[1:]: +        s += i +        if f and (s >= 0): +            ans += s + 1 +            s = -1 +        if not f and (s <= 0): +            ans += 1 - s +            s = 1 +        f ^= 1 +    print((min(m, ans))) +    return + + +# Solve +if __name__ == "__main__": +    solve()