import java.io.*;
import java.util.*;

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

}
