# ARC072C - Sequence (ABC059C)

def main():

    n = int(eval(input()))

    lst = list(map(int, input().rstrip().split()))

    cnt = [0] * 2

    

    # start with positive number

    cur = 0

    for i, j in enumerate(lst):

        cur += j

        if i % 2 == 0 and cur <= 0:

            cnt[0] += abs(cur) + 1

            cur = 1

        elif i % 2 == 1 and cur >= 0:

            cnt[0] += abs(cur) + 1

            cur = -1



    # start with negative number

    cur = 0

    for i, j in enumerate(lst):

        cur += j

        if i % 2 == 0 and cur >= 0:

            cnt[1] += abs(cur) + 1

            cur = -1

        elif i % 2 == 1 and cur <= 0:

            cnt[1] += abs(cur) + 1

            cur = 1



    print((min(cnt)))





if __name__ == "__main__":

    main()
# ARC072C - Sequence (ABC059C)

def modify_seq(seq: list, is_positive: bool) -> int:

    cur, cnt = 0, 0

    for i in seq:

        cur += i

        if is_positive and cur <= 0:

            cnt += abs(cur) + 1

            cur = 1

        elif not is_positive and cur >= 0:

            cnt += abs(cur) + 1

            cur = -1

        is_positive = not is_positive

    return cnt





def main():

    _, *A = list(map(int, open(0).read().split()))

    print((min(modify_seq(A, True), modify_seq(A, False))))





if __name__ == "__main__":

    main()

# ARC072C - Sequence (ABC059C)
def main():
    n = int(eval(input()))
    lst = list(map(int, input().rstrip().split()))
    cnt = [0] * 2
    # start with positive number
    cur = 0
    for i, j in enumerate(lst):
        cur += j
        if i % 2 == 0 and cur <= 0:
            cnt[0] += abs(cur) + 1
            cur = 1
        elif i % 2 == 1 and cur >= 0:
            cnt[0] += abs(cur) + 1
            cur = -1
    # start with negative number
    cur = 0
    for i, j in enumerate(lst):
        cur += j
        if i % 2 == 0 and cur >= 0:
            cnt[1] += abs(cur) + 1
            cur = -1
        elif i % 2 == 1 and cur <= 0:
            cnt[1] += abs(cur) + 1
            cur = 1
    print((min(cnt)))


if __name__ == "__main__":
    main()

# ARC072C - Sequence (ABC059C)
def modify_seq(seq: list, is_positive: bool) -> int:
    cur, cnt = 0, 0
    for i in seq:
        cur += i
        if is_positive and cur <= 0:
            cnt += abs(cur) + 1
            cur = 1
        elif not is_positive and cur >= 0:
            cnt += abs(cur) + 1
            cur = -1
        is_positive = not is_positive
    return cnt


def main():
    _, *A = list(map(int, open(0).read().split()))
    print((min(modify_seq(A, True), modify_seq(A, False))))


if __name__ == "__main__":
    main()

+def modify_seq(seq: list, is_positive: bool) -> int: +    cur, cnt = 0, 0 +    for i in seq: +        cur += i +        if is_positive and cur <= 0: +            cnt += abs(cur) + 1 +            cur = 1 +        elif not is_positive and cur >= 0: +            cnt += abs(cur) + 1 +            cur = -1 +        is_positive = not is_positive +    return cnt + + -    n = int(eval(input())) -    lst = list(map(int, input().rstrip().split())) -    cnt = [0] * 2 -    # start with positive number -    cur = 0 -    for i, j in enumerate(lst): -        cur += j -        if i % 2 == 0 and cur <= 0: -            cnt[0] += abs(cur) + 1 -            cur = 1 -        elif i % 2 == 1 and cur >= 0: -            cnt[0] += abs(cur) + 1 -            cur = -1 -    # start with negative number -    cur = 0 -    for i, j in enumerate(lst): -        cur += j -        if i % 2 == 0 and cur >= 0: -            cnt[1] += abs(cur) + 1 -            cur = -1 -        elif i % 2 == 1 and cur <= 0: -            cnt[1] += abs(cur) + 1 -            cur = 1 -    print((min(cnt))) +    _, *A = list(map(int, open(0).read().split())) +    print((min(modify_seq(A, True), modify_seq(A, False))))