import java.util.Scanner;

public class AA {
public static void main(String[] args) {
	Scanner sc= new Scanner(System.in);
	int n = sc.nextInt();
	int [] pos =new int[n/2];
	for (int i = 0; i < pos.length; i++) {
		pos[i] =sc.nextInt()-1;
	}
	int [] black = new int[n/2];
	for (int i = 0; i < black.length; i++) {
		black[i] = (i<<1);
	}
	int [] w = new int[n/2];
	for (int i = 0; i < black.length; i++) {
		w[i] = (i<<1) +1;
	}
	int one = 0, two = 0;
	for (int i = 0; i < w.length; i++) {
		two+=Math.abs(pos[i]-w[i]);
	}
	for (int i = 0; i < w.length; i++) {
		one+=Math.abs(pos[i]-black[i]);
	}
	System.out.println(Math.min(one,  two));
}
}
