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

public class A {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		
		int[] a = new int[n/2];
		for(int i = 0; i < n/2; ++i) a[i] = in.nextInt();
		Arrays.sort(a);
		
		int min = 10000;
		int c = 0;
		for(int i = 0; i < n/2; ++i) {
			c+= Math.abs(a[i] - (2*i+1));
		}
		
		min =Math.min(c, min);
		c = 0;
		for(int i = 0; i < n/2; ++i) {
			c+= Math.abs(a[i] - (2*i+2));
		}
		min = Math.min(min, c);
		System.out.println(min);
		
	}

}
