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

public class A985 {

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