import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.IOException;
import java.io.FileReader;
import java.io.FileWriter;

import java.util.Arrays;
import java.util.Collections;
import java.util.ArrayList;
import java.util.List;
import java.util.HashSet;
import java.util.Comparator;
import java.util.Set;
import java.util.HashMap;
import java.util.Map;

public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    /* 標準入力数値配列用 long */
    static long[] inputLongArr() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        long[] longarray = new long[strarray.length];
        for (int i = 0; i < longarray.length; i++) {
            longarray[i] = Long.parseLong(strarray[i]);
        }
        return longarray;
    }

    // 標準入力数値リスト用 int
    static List<Integer> inputIntList() throws Exception {
        List<String> strList = Arrays.asList(br.readLine().trim().split(" "));
        List<Integer> intList = new ArrayList<Integer>();
        for (String elem : strList){
            intList.add(Integer.parseInt(elem));
        }
        return intList;
    }

    // 標準入力数値配列用 integer 降順ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    /*標準入力long*/
    static long inputLong() throws Exception {
        return Long.parseLong(br.readLine());
    }

    /*標準入力long*/
    static int inputInt() throws Exception {
        return Integer.parseInt(br.readLine());
    }




    public static void main(String[] args) throws Exception {
        // write your code here
        int n = inputInt();
        long [] al = inputLongArr();

        boolean nextPlusF = al[0] < 0;
        long sum2;
        long ans2;
        long ans = 0;
        long sum = al[0];
        if (al[0] == 0){
            sum = 1;
            ans += 1;
        }
        if (nextPlusF){
            sum2 = 1;
            ans2 = 1 - (al[0]);
        }else{
            sum2 = -1;
            ans2 = al[0] + 1;
        }




        for(int i=1;i<n;i++){
            sum += al[i];
            if(nextPlusF && sum <=0){
                ans += 1-sum;
                sum += 1-sum;
            }else if ((! nextPlusF) && sum >= 0){
                ans += sum +1;
                sum -= sum +1;
            }
            nextPlusF = !nextPlusF;
        }

        nextPlusF = !(al[0] < 0);
        for(int i=1;i<n;i++){
            sum2 += al[i];
            if(nextPlusF && sum2 <=0){
                ans2 += 1-sum2;
                sum2 += 1-sum2;
            }else if ((! nextPlusF) && sum2 >= 0){
                ans2 += sum2 +1;
                sum2 -= sum2 +1;
            }
            nextPlusF = !nextPlusF;
        }


        System.out.println(Math.min(ans,ans2));

    }

}



Measured memory_bytes: 47096