


import java.util.*;

public class test
{
    private static Scanner sc = new Scanner(System.in);
    //sc.nextInt()   read int


    public static void main(String[] args)
    {

        int n = sc.nextInt();


        int data[] = new int[n/2];
		
		for(int i=0;i<n/2;i++)data[i] = sc.nextInt();
		Arrays.sort(data);
		
		int answer1 = 0;
		int answer2 = 0;
		
		for(int i=0;i<n/2;i++)
		{
			answer1 += Math.abs(i*2+1-data[i]);
			answer2 += Math.abs(i*2+2-data[i]);
		}
		
		System.out.println(Math.min(answer1,answer2));


    }
}

