import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

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

		SC scan = new SC();
		PrintWriter pw = new PrintWriter(System.out);
	
		int n = scan.nextInt(), a = 0, b = 0;
		int[] p = new int[n];
		for(int i = 0; i < n/2; i++) {
			p[i] = scan.nextInt();
		}
		Arrays.sort(p);
		for(int i = 1; i < n; i+=2)
			a += Math.abs(i - p[i/2]);
		for(int i = 2; i < n; i+=2)
			b += Math.abs(i - p[(i-1)/2]);
		pw.println(Math.min(a, b));
		
		
		pw.flush();
	}
	

	
	static class SC {

		BufferedReader br;
		StringTokenizer st;

		public SC() throws Exception {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer("");
		}

		public SC(String fn) throws Exception {
			br = new BufferedReader(new FileReader(fn));
			st = new StringTokenizer("");
		}

		String nextLine() throws Exception {
			return br.readLine();
		}

		String next() throws Exception {
			while (!st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		int nextInt() throws Exception {
			return Integer.parseInt(next());

		}

		double nextDouble() throws Exception {
			return Double.parseDouble(next());
		}

		long nextLong() throws Exception {
			return Long.parseLong(next());
		}
	}
}