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

import static java.lang.Math.abs;
import static java.lang.Math.min;


public class chesses {

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] arr = new int[n / 2];

        for (int i = 0; i < n / 2;i++) {
            arr[i] = scan.nextInt();
        }

        Arrays.sort(arr);

        long fSum = 0;

        for (int i = 0;i < n/2;i++) fSum += abs(arr[i] - (i * 2 + 1));

        long sSum = 0;

        for (int i = 0;i < n/2;i++) sSum += abs(arr[i] - (i * 2 + 2));

        System.out.print(min(sSum, fSum));

    }
}
