import java.io.*;
import java.util.*;
public class asitis
{
		
	public static void main(String[] args)throws IOException{
	BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
	
	int n=Integer.parseInt(bf.readLine());
	String[] s=bf.readLine().split(" ");
	int[] a=new int[n];
	int[] in=new int[n/2];
	for(int i=0;i<n/2;i++)
	{
		a[Integer.parseInt(s[i])-1]=1;
		in[i]=Integer.parseInt(s[i])-1;
	}
	Arrays.sort(in);
	int cb=0,cw=0;
	int i=0,j=0;
	while(i<n)
	{
		cb+=(int)Math.abs(in[j]-i);
		i+=2;j++;
	}
	i=1;j=0;
	while(i<n)
	{
		cw+=(int)Math.abs(in[j]-i);
		i+=2;j++;
	}
	System.out.println(Math.min(cw,cb));

	

	}
}