import java.util.*;
import java.lang.*;


public class Practice {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] arr = new int[n];
    for(int i=0; i < n/2; i++) {
    	arr[i] = sc.nextInt();
    }
    int res = Integer.MAX_VALUE;
    
    Arrays.sort(arr);
    int to = 0;
    int te = 0;
    for(int i=1, j=0, k=0 ;i < n; i+=2, j++, k+=2) {
    	to+=Math.abs(arr[j]-i-1);
    	te+=Math.abs(arr[j]-k-1);
    	System.out.println("tee: "+te);
    }
    System.out.println(Math.min(to, te));
  }
  
  
 
}

