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

public class Solution{
	
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] p = new int[n/2];
		for(int i = 0 ; i < n/2 ; i++)
			p[i] = sc.nextInt();
		Arrays.sort(p);
		int count1 = 0, count2 = 0;
		int step = 2;
		int nextNum = 1;
		for(int i = 0 ; i < n/2 && nextNum <= n; i++){
			count1 += Math.abs(p[i] - nextNum);
			nextNum += step;
			//System.out.println("count1 = " + count1 + " nextNum = " + nextNum);
		}
		nextNum = 2;
		for(int i = 0 ; i < n/2 && nextNum <= n; i++){
			count2 += Math.abs(p[i] - nextNum);
			nextNum += step;
			//System.out.println("count2 = " + count2 + " nextNum = " + nextNum);
		}
		//System.out.println("Count1 = " + count1 + " Count2 = " + count2);
		System.out.println(Math.min(count1, count2));
	}
	
}