import java.io.*;
import java.util.*;
import java.util.regex.*;
public class vk18
{
    public static void main(String[]stp) throws Exception
    {
    	Scanner scan=new Scanner(System.in);
        //BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //String []s;
        int n=scan.nextInt(),i,min1=0,min2=0;
        Integer a[]=new Integer[n/2];
        for(i=0;i<n/2;i++) a[i]=scan.nextInt();
        Arrays.sort(a);       
    	for(i=0;i<n/2;i++)
    	{
    		min1+=Math.abs(a[i]-(i*2 +1));
    		min2+=Math.abs(a[i]-(i*2 +2));
    	}
    	System.out.println(Math.min(min1,min2));

    }
}