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

public class educational_44_a {
	public static void main(String args[]){
		FScanner in = new FScanner();
		PrintWriter out = new PrintWriter(System.out);
		//int t = in.nextInt();
		//while(t-->0) { }
		int n=in.nextInt();
		int a[]=new int[n/2];
		for(int i=0;i<n/2;i++)
		{
			a[i]=in.nextInt();
		}
	    Arrays.sort(a);
		
		int ans=0,ans1=0;
		for(int i=0;i<n/2;i++)
		{
         ans+=Math.abs(a[i]-(i*2+1));
         ans1+=Math.abs(a[i]-(i*2+2));
        }
       // out.println(ans+" "+ans1);
        out.println(Math.min(ans,ans1));
		out.close();
	}

    static class FScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer sb = new StringTokenizer("");
 
		String next(){
			while(!sb.hasMoreTokens()){
				try{
					sb = new StringTokenizer(br.readLine());
				} catch(IOException e){ }
			}
			return sb.nextToken();
		}
		String nextLine(){
			try{ return br.readLine(); } 
			catch(IOException e) { } return "";
		}
 
		int nextInt(){
			return Integer.parseInt(next());
		}
 
		long nextLong() {
			return Long.parseLong(next());
		}
 
		int[] readArray(int n) {
			int a[] = new int[n];
			for(int i=0;i<n;i++) a[i] = nextInt();
			return a;
		}
 
		float nextFloat(){
		return Float.parseFloat(next());
		}
		
		double nextDouble(){
		return Double.parseDouble(next());
		}
	}
}
