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

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int half = n / 2;
        int blacksum = 0;
        int whitesum = 0;

        int arr[] = new int[half];
        for (int i = 0; i < half; i++) {
            arr[i] = sc.nextInt() - 1;
         }
        Arrays.sort(arr);
        for (int i = 0; i < half; i++) {
            blacksum += Math.abs(i*2-arr[i]);
            whitesum += Math.abs((i*2+1)-arr[i]);
        }
        System.out.println(Math.min(blacksum,whitesum));

    }
}
