import java.io.*;
import java.util.*;
public class A{
	public static void main(String[] args)throws Throwable {
		MyScanner sc=new MyScanner();
		PrintWriter pw=new PrintWriter(System.out);
		
		int x=0,y=0;
		int n=sc.nextInt();
		int [] a=new int [n/2];
		for(int i=0;i<n/2;i++)
			a[i]=sc.nextInt()-1;
		Arrays.sort(a);
		for(int i=0;i<n/2;i++) {
			x+=Math.abs(2*i-a[i]);
			y+=Math.abs(2*i+1-a[i]);
		}
		pw.println(Math.min(x, y));
		pw.flush();
		pw.close();
    }
	
	static class MyScanner {
		BufferedReader br;
		StringTokenizer st;
		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		String next() {while (st == null || !st.hasMoreElements()) {
			try {st = new StringTokenizer(br.readLine());}
			catch (IOException e) {e.printStackTrace();}}
		return st.nextToken();}
		int nextInt() {return Integer.parseInt(next());}
		long nextLong() {return Long.parseLong(next());}
		double nextDouble() {return Double.parseDouble(next());}
		String nextLine(){String str = "";
		try {str = br.readLine();}
		catch (IOException e) {e.printStackTrace();}
		return str;}
	}
} 