import java.util.Scanner;
import java.lang.Math;
import java.util.Arrays;

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