
import java.util.Arrays;
import java.util.Scanner;

public class problem221 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ar[]  = new int[n/2];
		for(int i = 0;i<n/2;i++)
		{
			ar[i] = sc.nextInt();
			
		}
		Arrays.sort(ar);
		int sum1 =0;
		int sum2 =0;
		int odd =1;
		int even =2;
		for(int i = 0;i<n/2;i++)
		{
		//	System.out.println(ar[i]);
			sum1 = sum1+Math.abs(ar[i]-odd);
			sum2 = sum2+Math.abs(ar[i]-even);
			//System.out.println(i+"  "+sum1+"  "+sum2);
			odd+= 2;
			even+=2;
			
		}
	//	System.out.println(sum1+"  "+sum2);
		System.out.println(Math.min(sum2, sum1));

	}

}
