import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;


public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] a = new int[n/2];
        for (int i = 0; i < n / 2 ; i++) {
            a[i] = in.nextInt() - 1;
        }
        Arrays.sort(a);
        int res = 0;
        int res2 = 0;
        for (int i = 0; i < n / 2; i++) {
            res += Math.abs(i * 2 - a[i]);
            res2 += Math.abs(i * 2 + 1 - a[i]);
        }
        System.out.println(Math.min(res, res2));
    }
}