import java.util.*;

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