import java.io.BufferedReader;
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.HashMap;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.StringTokenizer;
import java.util.TreeSet;



public class Main{
	
	static PrintWriter pr = new PrintWriter(System.out);
	static ArrayList<Integer> primes;
	
	static int [] isComposite;
	
	static void sieve(int N){
		isComposite = new int[N+1];
		isComposite[0] = 	isComposite[1] = 1;
		primes = new ArrayList<Integer>();
		
		for(int i=2; i<=N; i++){
			if(isComposite[i]==0){
				primes.add(i);
				if(1l*i*i<=N){
					for(int j=i*i; j<=N; j+=i){
						isComposite[j]= 1;
					}
				}
			}
		}
	}
	
	public static void main(String args[]) throws IOException{
		Scanner sc = new Scanner(System.in);
		
//		sieve(10000000);
		
		int n = sc.nextInt();
		int a[] = new int[n/2];
		for(int i=0; i<n/2; i++)
			a[i] = sc.nextInt();
		Arrays.sort(a);
		int first=0,second=0;;
		for(int i=1; i<=n/2; i++){
			first+=Math.abs(1+2*i-a[i-1]);
//			second+=Math.abs(2*i-a[i-1]);
		}
		for(int i=0; i<n/2; i++){
			second+=Math.abs(1+2*i-a[i]);
		}
		pr.println(Math.min(first, second));
		
		pr.close();
		
	}
	
	static class Scanner{
		StringTokenizer st;
		BufferedReader br;
		
		public Scanner(InputStream s){
			br = new BufferedReader(new InputStreamReader(s));
		}
		
		public String next() throws IOException{
			while(st==null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public String nextLine() throws IOException{
			return br.readLine();
		}
		
		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}
		public long nextLong() throws NumberFormatException, IOException{
			return Long.parseLong(next());
		}
		
		public boolean ready() throws IOException{
			return br.ready();
		}
	}
	

}