import sys



def solve():

    n = int(eval(input()))

    a = [int(i) for i in input().split()]



    ans1 = 0 if a[0] > 0 else abs(a[0] - 1)

    v = a[0] if a[0] > 0 else 1



    for i in range(1, n):

        if v * (v + a[i]) < 0:

            v += a[i]

        else:

            if v > 0:

                ans1 += abs(v + a[i] + 1)

                v = -1

            else:

                ans1 += abs(v + a[i] - 1)

                v = 1



    ans2 = 0 if a[0] < 0 else abs(a[0] + 1)

    v = a[0] if a[0] < 0 else -1



    for i in range(1, n):

        if v * (v + a[i]) < 0:

            v += a[i]

        else:

            if v > 0:

                ans2 += abs(v + a[i] + 1)

                v = -1

            else:

                ans2 += abs(v + a[i] - 1)

                v = 1



    ans = min(ans1, ans2)



    print(ans)



if __name__ == '__main__':

    solve()
import sys



def solve():

    n = int(eval(input()))

    a = [int(i) for i in input().split()]



    ans1 = scan(a, -1)

    ans2 = scan(a, 1)



    ans = min(ans1, ans2)



    print(ans)



def scan(a, sgn):

    if a[0] * sgn > 0:

        res = 0

        v = a[0]

    else:

        res = abs(a[0] - sgn)

        v = sgn



    for ai in a[1:]:

        if v * (v + ai) < 0:

            v += ai

        else:

            if v > 0:

                res += abs(v + ai + 1)

                v = -1

            else:

                res += abs(v + ai - 1)

                v = 1



    return res



if __name__ == '__main__':

    solve()
import sys


def solve():
    n = int(eval(input()))
    a = [int(i) for i in input().split()]
    ans1 = 0 if a[0] > 0 else abs(a[0] - 1)
    v = a[0] if a[0] > 0 else 1
    for i in range(1, n):
        if v * (v + a[i]) < 0:
            v += a[i]
        else:
            if v > 0:
                ans1 += abs(v + a[i] + 1)
                v = -1
            else:
                ans1 += abs(v + a[i] - 1)
                v = 1
    ans2 = 0 if a[0] < 0 else abs(a[0] + 1)
    v = a[0] if a[0] < 0 else -1
    for i in range(1, n):
        if v * (v + a[i]) < 0:
            v += a[i]
        else:
            if v > 0:
                ans2 += abs(v + a[i] + 1)
                v = -1
            else:
                ans2 += abs(v + a[i] - 1)
                v = 1
    ans = min(ans1, ans2)
    print(ans)


if __name__ == "__main__":
    solve()

import sys


def solve():
    n = int(eval(input()))
    a = [int(i) for i in input().split()]
    ans1 = scan(a, -1)
    ans2 = scan(a, 1)
    ans = min(ans1, ans2)
    print(ans)


def scan(a, sgn):
    if a[0] * sgn > 0:
        res = 0
        v = a[0]
    else:
        res = abs(a[0] - sgn)
        v = sgn
    for ai in a[1:]:
        if v * (v + ai) < 0:
            v += ai
        else:
            if v > 0:
                res += abs(v + ai + 1)
                v = -1
            else:
                res += abs(v + ai - 1)
                v = 1
    return res


if __name__ == "__main__":
    solve()

-    ans1 = 0 if a[0] > 0 else abs(a[0] - 1) -    v = a[0] if a[0] > 0 else 1 -    for i in range(1, n): -        if v * (v + a[i]) < 0: -            v += a[i] -        else: -            if v > 0: -                ans1 += abs(v + a[i] + 1) -                v = -1 -            else: -                ans1 += abs(v + a[i] - 1) -                v = 1 -    ans2 = 0 if a[0] < 0 else abs(a[0] + 1) -    v = a[0] if a[0] < 0 else -1 -    for i in range(1, n): -        if v * (v + a[i]) < 0: -            v += a[i] -        else: -            if v > 0: -                ans2 += abs(v + a[i] + 1) -                v = -1 -            else: -                ans2 += abs(v + a[i] - 1) -                v = 1 +    ans1 = scan(a, -1) +    ans2 = scan(a, 1) +def scan(a, sgn): +    if a[0] * sgn > 0: +        res = 0 +        v = a[0] +    else: +        res = abs(a[0] - sgn) +        v = sgn +    for ai in a[1:]: +        if v * (v + ai) < 0: +            v += ai +        else: +            if v > 0: +                res += abs(v + ai + 1) +                v = -1 +            else: +                res += abs(v + ai - 1) +                v = 1 +    return res + +