import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class prog {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
		int mas[] = new int[n / 2];
		for (int i = 0; i < mas.length; i++) {
			mas[i] = in.nextInt();
		}
		int l = 0, r = 0;
		Arrays.sort(mas);
		for (int i = 0; i < mas.length; i++) {
			l += Math.abs(mas[i] - (2 * i + 1));
			r += Math.abs(mas[i] - (2 * i + 2));
		}
		out.println(Math.min(l, r));
		in.close();
		out.close();
	}
}