
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;

import javax.swing.JOptionPane;

public class Main {

	public static void main(String[] args) throws Exception {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();

		int m[] = new int[(N/2)+1];
		
		int m2[] = new int[(N/2)+1];

		int t1[] = new int[(N/2)+1];

		int t2[]=new int[(N/2)+1];
		
		int sum1 = 0, sum2 = 0;

		int aa=1;
		
		
		for (int i = 1; i <= (N / 2); i++) {

			int a = sc.nextInt();

			m[i] = a;
			m2[i]=a;
			
			
			t1[i]=aa;
			aa++;
			t2[i]=aa;
			aa++;
			
		}

		Arrays.sort(m);
		
		for(int i=1;i<=(N/2);i++) {
			
			sum1+=Math.abs(m[i]-t1[i]);
			sum2+=Math.abs(m2[i]-t2[i]);
			
		}
		
		if(sum1>sum2) {
			
			System.out.println(sum2);
			
		}
		else {
			System.out.println(sum1);
			
		}

	}

}
