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

public class prac
{
    public static void main(String args[]){
    	
    	Scanner sc = new Scanner(System.in);
    	
    	int n=sc.nextInt();
    	
    	int a[] = new int[n/2];
    	int b[] = new int[n/2];
    	int c[] = new int[n/2];
    	
    	for(int i=0 ; i<n/2; i++)
    		a[i] = sc.nextInt();
    		
    	int t=0;
    	int h=0;
    	for(int i=0; i<n; i++){
    		if((i+1)%2==0){
    			c[t]=i+1;
    			t++;
    		}else{
    			b[h]=i+1;
    			h++;
    		}
    	}
    	
    	Arrays.sort(a, 0, n/2);
    	
    	int co = 0;
    	for(int i=0; i<n/2; i++){
    		
    		co=co+(Math.abs(b[i]-a[i]));
    	}
    	
    	int cb = 0;
    	for(int i=0; i<n/2; i++){
    		
    		cb=cb+(Math.abs(c[i]-a[i]));
    	}
    	
    	if(co<cb)
    		System.out.println(co);
    	else
    		System.out.println(cb);
    }
}