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

public class Main {
	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
		int n,k,temp;
		n=in.nextInt();
	    k=n/2;
	    int[] pos=new int[k];
	   
	    for(int i=0;i<n/2;i++){
	      pos[i]=in.nextInt();
	    }
	    sort(pos,0,pos.length-1);
	    //
	    int val=2,moves=0,dif=0;
	    for(int g:pos){
	        if(g>val)
	        dif+=g-val;
	        else
	        dif+=val-g;
	        val+=2;
	    }
        moves=dif;
        dif=0;
        val=1;
         for(int g:pos){
             	System.out.print(g);

	        if(g>val)
	        dif+=g-val;
	        else
	        dif+=val-g;
	        val+=2;
	    }
	    if(moves>dif)
	System.out.print(dif);
    else
	System.out.print(moves);

	
	
		}
		
		static int binary(long[] arr,long x,int l, int r){
		  

     
            int mid = l + (r - l)/2;
            if(mid==0){
                if(arr[mid]>=x)
                return mid;
                else
                return binary(arr, x,mid+1, r);
            }
 
            if (arr[mid] >= x&&arr[mid-1]<x)
               return mid;
 
            if (arr[mid] > x)
               return binary(arr,x, l, mid-1);
 
            return binary(arr, x,mid+1, r);
        
		    
		}
		
	 static void merge(int arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;
 
        /* Create temp arrays */
        int L[] = new int [n1];
        int R[] = new int [n2];
 
        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];
 
 
        /* Merge the temp arrays */
 
        // Initial indexes of first and second subarrays
        int i = 0, j = 0;
 
        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }
 
        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }
 
        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }
 
    // Main function that sorts arr[l..r] using
    // merge()
    static void sort(int arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;
 
            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);
 
            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }
		
		
		//end class
	}