import java.util.Arrays;
import java.util.Scanner;
public class A {
	public static void main (String[] args){
	    Scanner sc = new Scanner(System.in);
	    int n = sc.nextInt();
	    int[] arr = new int[n / 2];
	    for(int i = 0; i < n / 2; ++i) arr[i] = sc.nextInt() - 1;
	    Arrays.sort(arr);
	    
	    int odd = 0, even = 0, nextOddIdx = 0, nextEvenIdx = 1;
	    for(int curr : arr){
	    	odd += Math.abs(curr - nextOddIdx);
	    	even += Math.abs(curr - nextEvenIdx);
	    	nextOddIdx += 2;
	    	nextEvenIdx += 2;
	    }
	    
	    System.out.println(Math.min(odd, even));
	}
}