import java.util.*;
import java.math.*;
import java.io.*;


public class q_3 {
    static Scanner sc;

    public static void main(String[] args){
        sc = new Scanner(System.in);
        int n = getInt();
        int[] arr = new int[n/2];
        for(int i=0 ; i<n/2 ; i++){
            arr[i] = getInt()-1;
        }
        Arrays.sort(arr);
        // all black
        int c=  0;
        long bb = 0l;
        for(int i=0 ; i<n/2 ; i++ , c+=2){
            bb+=Math.abs(arr[i]-c);
        }
        long ww = 0l;
        c = 1;
        for(int i=0 ; i<n/2 ; i++ , c+=2){
            ww+=(Math.abs(arr[i] - c));
        }
        System.out.println(Math.min(bb,ww));

    }





    public static int getInt(){
        return sc.nextInt();
    }

    public static String getString(){
        return sc.next();
    }

    public static String nextLine(){
        return sc.nextLine();
    }

    public static long nextLong(){
        return sc.nextLong();
    }

}
