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

public class A985 {
	public static void main(String[] args) throws Exception {
		int n = i(), odd = 0, even = 0;

		int[] pos = new int[n / 2 + 1];

		for (int i = 1; i <= n / 2; i++) {
			pos[i] = i();
		}
		Arrays.sort(pos);

		for (int i = 1; i <= n / 2; i++) {
			odd += Math.abs(i * 2 - 1 - pos[i]);
			even += Math.abs(i * 2 - pos[i]);
		}

		out.println(Math.min(odd, even));

		out.close();
	}

	static BufferedReader in;
	static StringTokenizer st = new StringTokenizer("");
	static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
	static {
		try {
			in = new BufferedReader(new FileReader("cf.in"));
		} catch (Exception e) {
			in = new BufferedReader(new InputStreamReader(System.in));
		}
	}
	static void check() throws Exception {
		if (!st.hasMoreTokens()) st = new StringTokenizer(in.readLine());
	}
	static int i() throws Exception {check(); return Integer.parseInt(st.nextToken());}
	static String s() throws Exception {check(); return st.nextToken();}
	static double d() throws Exception {check(); return Double.parseDouble(st.nextToken());}
	static long l() throws Exception {check(); return Long.parseLong(st.nextToken());}
}
