
import java.util.*;
public class Chess {
 int sub(int a,int b)
 {
	 if(a>b)
		 return a-b;
	 else
		 return b-a;
 }
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		Chess ch=new Chess();
		int n=sc.nextInt();
		int[] arr=new int[n+1];
		for(int i=1;i<=n/2;i++)
			{
			int x=sc.nextInt();
			arr[x]=1;
			}
		int count=0,count2=0;
		int y=n;
		for(int i=n;i>0;i--)
		{
			if(arr[i]==1)
				{
				count=count+ch.sub(y,i);
				y=y-2;
				}
			
		}
		y=n-1;
		for(int i=n;i>0;i--)
		{
			if(arr[i]==1)
			{
				count2=count2+ch.sub(y,i);
				y=y-2;
			}
			
		}
		if(count<count2)
			System.out.println(count);
		else
		System.out.println(count2);
		
sc.close();
	}

}
