import java.util.Arrays;
import java.util.Scanner;

public class A985 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int[] P = new int[N/2];
        for (int n=0; n<N/2; n++) {
            P[n] = in.nextInt() - 1;
        }
        Arrays.sort(P);
        int black = 0;
        int white = 0;
        for (int n=0; n<N/2; n++) {
            int p = P[n];
            black += Math.abs(2*n-p);
            white += Math.abs(2*n+1-p);
        }
        int answer = Math.min(black, white);
        System.out.println(answer);
    }

}
