
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
    private static final PrintStream ps = System.out;
    private static final Scanner     sc = new Scanner(System.in);

    public static void main(String[] args) {
        int n = sc.nextInt();
        int[] a = new int[n/2];
        
        for (int i = 0; i < n/2; i++) {
            a[i] = sc.nextInt();
        }
        Arrays.sort(a);
        int countE = 0;
        for (int i = 2; i <= n; i+=2) {
            countE += Math.abs(i - a[i/2 - 1]);
        }
        
        int countO = 0;
        for (int i = 1; i <= n-1; i+=2) {
            countO += Math.abs(i - a[i/2]);
        }
        ps.println(Math.min(countE, countO));
    }
}
