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

public class a {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] a = new int[n/2];
		boolean even =true;
		for(int i = 0; i<a.length; i++){
			a[i] = in.nextInt();
			
		}
		Arrays.sort(a);
		if(a[0]==1)even = false;
		int moves = 0;
		if(even){
			for(int i = 2, j=0; i<=n && j<a.length; i+=2, j++){
				moves += Math.abs(a[j]-i);
			}
		}else{
			for(int i = 1, j = 0;i<=n-1 && j<a.length;i+=2, j++){
				moves += Math.abs(a[j]-i);
			}
		}
		System.out.println(moves);
	}

}
