import java.util.Scanner;

public class Problem1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int i,j,k,sum,n,sum1;

        String s;
        while (input.hasNext()){
            n = input.nextInt(); sum = 0; sum1 = 0;
            boolean[] brr = new boolean[n+1];
            int[] arr  = new int[n+1];
            for (i=1; i<= n/2; i++)
                arr[i] = input.nextInt();
           // System.out.println(arr[3]);
            for (i=1; i<=n; i++){
                if (arr[i] != 0)
                    brr[arr[i]] = true;
            }
            /*for (i=1; i<=n; i++)
                System.out.println(arr[i]);*/
            for (i=1; i<=n; i++){
                if (arr[i] % 2 != 0){
                    for (j=2; j<=n; j = j+2){
                        if (brr[j] == false){
                            brr[j] = true;
                            sum  += Math.abs(j - arr[i]); //System.out.println(sum + " " +arr[i] + " " +j);
                            break;
                        }
                    }
                }
            }
           // System.out.println(sum);

            //System.out.println(brr[3]);
            for (i=1; i<=n; i++){
                if (arr[i] % 2 == 0 && arr[i] != 0){
                    //System.out.println("yes");
                    for (j=1; j<=n; j = j+2){
                        if (brr[j] == false){
                            brr[j] = true;
                            sum1  += Math.abs(j - arr[i]);//System.out.println(sum1 + " " + i + " " +j);
                            break;
                        }
                    }
                }
            }
           // System.out.println("sum1" +sum1 + "sum" + sum);
            if (sum >= sum1) System.out.println(sum1);
            else System.out.println(sum);
        }
    }
}
