import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
	static void printArray(int[] arr){
		for(int i=0;i<arr.length;i++){
			System.out.print(arr[i]+" ");
		}
		System.out.println();
	}
	
	static int distanceBetween(int[] arr1, int[] arr2){
		int n = arr1.length;
		int sum =0;
		for(int i=0;i<n;i++){
			sum += Math.abs(arr1[i]-arr2[i]);
		}
		return sum;
	}
	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;
		}
		int even[] = new int[n/2];
		int odds[] = new int[n/2];
		
		Arrays.sort(arr);
		
		for(int i=0;i<n/2;i++){
			even[i] = 2*i;
			odds[i] = 2*i+1;
		}
		int resp = distanceBetween(arr, even);
		resp = Math.min(resp, distanceBetween(arr, odds));
		System.out.println(resp);
		
	}
}
