import java.util.*;
public class G {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int count = 0;
		int[] a = new int[n/2];
		Arrays.sort(a);
		for(int i=0;i<n/2;i++) {
			a[i] = in.nextInt();
		}
		for(int i=0;i<n/2;i++) {
			count+=Math.abs((i*2+1)-a[i]);
		}
		int count2 = 0;
		for(int i=0;i<n/2;i++) {
			count2+=Math.abs((i+1)*2-a[i]);
		}
		if(count<count2) {
			System.out.println(count);
		}else {
			System.out.println(count2);
		}
	}
}