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[] values = new int[n / 2];
		for(int i = 0; i < values.length; i++) {
			values[i] = in.nextInt() - 1;
		}
		Arrays.sort(values);
		
		int counter1 = 0;
		// black
		for(int i = 0; i < values.length; i++) {
			counter1 += Math.abs(values[i] - 2 * i); 
		}
		
		int counter2 = 0;
		// black
		for(int i = 0; i < values.length; i++) {
			counter2 += Math.abs(values[i] - (2 * i + 1)); 
		}
		
		System.out.println(Math.min(counter1, counter2));
		in.close();
	}
}
