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

public class CF985A {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] pieces = new int[n / 2];
        for (int i = 0; i < n / 2; i++) {
            pieces[i] = scanner.nextInt();
        }
        Arrays.sort(pieces);

        int s1 = 0, s2 = 0;
        for (int i = 0; i < pieces.length; i++) {
            s1 += Math.abs(pieces[i] - (i * 2 + 1));
            s2 += Math.abs(pieces[i] - (i * 2 + 2));
        }

        System.out.print(Math.min(s1, s2));
    }

}