import java.util.Scanner;
import java.util.*;

public class aProb {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		scan.nextLine();
		int black = 0;
		int white = 0;
		
		int arr[] = new int[n/2];
		for(int i = 0; i<arr.length; i++){
			arr[i]=scan.nextInt();
		
		}
			Arrays.sort(arr);
			int []b = new int[n/2];
			int []w = new int[n/2];
		for(int i=0;i<arr.length;i++){
			b[i]=i*2+1;
			w[i]=(1+i)*2;
		}
		for(int i=0;i<arr.length;i++){
			black+=Math.abs(b[i]-arr[i]);
			white+=Math.abs(w[i]-arr[i]);
		}

		System.out.println(Math.min(black, white));

		
	}
}