//package p985;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class A {
	static PrintWriter out = new PrintWriter(System.out);
	static <T> void print(T t) {
		out.println(t);
	}
	static <T> void print2(T t) {
		System.out.println(t);
	}
	public static void main(String[] args) throws FileNotFoundException {
		InputStream is = System.in;
		//is = new FileInputStream("A.txt");

		Scanner sc = new Scanner(is);
		int f = sc.nextInt();
		int a[]=new int[f];
		int b=0,w=0;
		
		for(int i=0; i<f/2; i++) {
			a[i]=sc.nextInt();
			//print2("   "+a[i]);
			if (a[i]%2==0) w++; else b++;
		}
		Arrays.sort(a);
//		print(b);
//		print(w);
		//print("-");
		int total1 = 0, total2=0;
		for (int i=0; i<f/2; i++) {
			//print(a[i]-2*i-1);
			total1 = total1 + Math.abs(a[i]-2*i-1);
		}
		//print("-");
		for (int i=0; i<f/2; i++) {
			//print(a[i]-2*i-2);
			total2 = total2 + Math.abs(a[i]-2*i-2);
		}
//		print(total1);
//		print(total2);
		print(Math.min(total1, total2));
		out.close();
		
	}

}