import java.io.*;
import java.util.*;
public class Chess_Placing
{
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int pos[] = new int[n/2];		
		for(int i =0; i<n/2;i++)
		{
				pos[i] = scan.nextInt();
		}	
		for(int i=0; i<n/2;i++)
		{
			for(int j=i+1;j<n/2;j++)
			{
				if(pos[i]>pos[j])
				{
					int tmp = pos[i];
					pos[i]= pos[j];
					pos[j]= tmp;				
				}			
			}		
		}
		int even=0,odd=0;
		//Starting even
		int evenn = n;
		int oddn = n-1;
		for(int i=(n/2)-1;i>=0;i--)
		{
			even = even + Math.abs(evenn-pos[i]);
			evenn = evenn -2;
		}
		//Starting Odd
		for(int i=(n/2)-1;i>=0;i--)
		{
			odd = odd + Math.abs(oddn-pos[i]);
			oddn = oddn -2;
		}
		if(even > odd)
			System.out.print(odd);
		else
			System.out.print(even);		
	}
}