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

public class EDU44A {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int black = 0;
		int white = 0;
		
		int[] arr = new int[n/2];
		for(int i = 0;i<n/2;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<n/2;i++){
			b[i]=i*2+1;
			w[i]=(i+1)*2;
		}
		for(int i = 0;i<n/2;i++){
			black+=Math.abs(b[i]-arr[i]);
			white+=Math.abs(w[i]-arr[i]);
		}
		System.out.println(Math.min(black, white));
		
		

	}

}
