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

public class p985A {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		int oddAns = 0, evenAns = 0;
		
		int[] pieces = new int[n/2];
		
		for (int i = 0; i < n/2; i++){
			pieces[i] = scan.nextInt() - 1;
		}
		
		Arrays.sort(pieces);
		
		for (int i= 0; i < pieces.length; i++){
			evenAns += Math.abs(pieces[i] - i*2);
			oddAns += Math.abs(pieces[i] - (i*2+1));
		}
		

		System.out.println(Math.min(oddAns, evenAns));
	}

}
