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


public class A985{
	
	private void solve() throws Exception {
		int n = nextInt();
		int[] p = new int[n/2];
		int r = 0;
		int rr = 0;
		for(int i = 0; i < n/2; i++) p[i] = nextInt()-1;
		Arrays.sort(p);
		for(int i = 0; i < n/2; i++) {
			r += Math.abs(p[i] - 2*i);
			rr += Math.abs(p[i] - (2*i+1));
		}
		out.println(Math.min(r, rr));
	}

	public static void main(String[] args) {
		(new A985()).run();
	} 
	

	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer tokenizer;

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
			out = new PrintWriter(System.out);
			solve();
			in.close();
			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	private int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	private long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	private float nextFloat() throws IOException {
		return Float.parseFloat(nextToken());
	}

	private String nextLine() throws IOException {
		return new String(in.readLine());
	}

	private String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(in.readLine());
		}
		return tokenizer.nextToken();
	}
	
	class Edge{
		int v;
		long w;
		
		public Edge(int v, long w){
			this.v = v;
			this.w = w;
		}
	}


}

