import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Stack;
import java.util.StringTokenizer;

public class Ezz {



	

	public static void main(String[]args) throws Throwable {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int arr[] = new int[n/2];
		for (int i = 0 ; i < n / 2 ; ++i) {
			arr[i] = sc.nextInt();
		}
		Arrays.sort(arr);
		// even
		int p = (n / 2 ) - 1; 
		long a1 = 0;
		for (int i = n ; i > 0 ; i -= 2) {
			a1 += Math.abs(arr[p--] - i);
		}
		long a2 = 0;
		p =  (n / 2) - 1;
		for (int i = n - 1 ; i > 0 ; i -= 2) {
			//System.out.println(arr[p] +" "+i);
			a2 += Math.abs(arr[p--] - i);
		}
	
		System.out.println(Math.min(a1, a2));
	}
	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

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

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

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

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

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

		public boolean ready() throws IOException {
			return br.ready();
		}
	}

}
