/*
 *
 * @author Mukesh Singh
 *
 */

import java.io.*;
import java.nio.file.FileStore;
import java.util.*;
import java.text.DecimalFormat;

public class Solution  {
	void solveT() throws Exception 	{
		int T = in.nextInt();
		for(int t= 1 ; t <= T  ;t++) {
			//solveT(t);		
		}
	}
	//solve test cases
	void solve() throws Exception {
		int n = in.nextInt();
		int white = 0;
		int black = 0;
		int[] a = new int[n/2];
		for(int i = 1 ; i <= n/2 ; ++i){
			a[i-1] = in.nextInt();
		}
		Arrays.sort(a);
		for(int i = 1 ; i <= n/2 ; ++i){
			int blackIndex = (i-1)*2+1;
			int whiteIndex = (i-1)*2+2;
			//System.out.println(blackIndex+" "+whiteIndex);
			black += Math.abs(a[i-1]-blackIndex);
			white += Math.abs(a[i-1]-whiteIndex);
		}
		System.out.println(Math.min(black, white));
	}
	
	//@ main function
	public static void main(String[] args) throws Exception {
		new Solution ();
	}
	
	InputReader in;
	PrintStream out ;
	DecimalFormat df ;
	Solution () {
		try {
			File defaultInput = new File("file.in");
			if (defaultInput.exists()) 
				in = new InputReader("file.in");
			else 
				in = new InputReader();
			defaultInput = new File("file.out");
			if (defaultInput.exists()) 
				out = new PrintStream(new FileOutputStream("file.out"));
			else
				out = new PrintStream(System.out);
			df = new DecimalFormat("######0.00");
			solve();
			out.close();
		} 
		catch (Exception e) {
			e.printStackTrace();
			System.exit(261);
		}
	}
	
	class InputReader {
		BufferedReader reader;
		StringTokenizer tokenizer;
		
		InputReader() {
			reader = new BufferedReader(new InputStreamReader(System.in));
		}
		
		InputReader(String fileName) throws FileNotFoundException {
			reader = new BufferedReader(new FileReader(new File(fileName)));
		}
		
		String readLine() throws IOException {
			return reader.readLine();
		}
		
		String nextToken() throws IOException {
			while (tokenizer == null || !tokenizer.hasMoreTokens())
				tokenizer = new StringTokenizer(readLine());
			return tokenizer.nextToken();
		}
		
		boolean hasMoreTokens() throws IOException {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				String s = readLine();
				if (s == null)
					return false;
				tokenizer = new StringTokenizer(s);
			}
			return true;
		}
		
		int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(nextToken());
		}
		
		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(nextToken());
		}
		
		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(nextToken());
		}
	}
}
