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

public class Main{

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		n /= 2;
		int a[] = new int[n];
		for(int i = 0 ; i < n ; i++) {
			a[i] = in.nextInt();
		}
		Arrays.sort(a);
		int sum1 = 0,sum2 = 0;
		int f = 1;
		for(int i = 0 ; i < n ; i++) {
				sum1 += Math.abs(f - a[i]);
			f += 2;
		}
		f = 2;
		for(int i = 0 ; i < n ; i++) {
				sum2 += Math.abs(f - a[i]);
			f += 2;
		}
		if(sum1 < sum2) {
			System.out.println(sum1);
		}else {
			System.out.println(sum2);
		}
		in.close();
	}

}

 		 	    				 		   	  				 	 	