import java.util.*;
import java.io.*;
import java.math.*;
public class codeforce{
    public static void merge(int[] l,int[] r,int[] a) {

			int i=0,j=0,k=0;
			int nl = l.length;
			int nr = r.length;
			while(i<nl && j<nr) {
				if(l[i]<r[j]) {
					a[k] = l[i];
					i++;
				}
				else {
					a[k] = r[j];
					j++;
				}
				k++;
			}
			while(i<nl) {
				a[k] = l[i];
				i++;
				k++;
			}
			while(j<nr) {
				a[k] = r[j];
				j++;
				k++;
			}
		}
		
		public static void mergesort(int[] a) {
			int n = a.length;
			if(n==1) {}
			else {
				int nl = n/2;
				int nr = n-nl;
				int[] l = new int[nl];
				int[] r = new int[nr];
				for(int i=0;i<nl;i++) l[i] = a[i];
				for(int i=nl;i<n;i++) r[i-nl] = a[i];
				mergesort(l);
				mergesort(r);
				merge(l,r,a);
			}
		}

    public static void main(String[] args) throws IOException{
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if(n==2) {
            int u = sc.nextInt();
            System.out.println("0");
        }
        else{
            int[] p = new int[n/2];
            int f=0,z=0;
            for(int i=0;i<n/2;i++) 
                p[i] = sc.nextInt();
                mergesort(p);
            for(int i=1;i<n;i+=2){
                f += Math.abs(i-p[i/2]);
                z += Math.abs(i+1-p[i/2]);
            }
            System.out.println(Math.min(z,f));
        }
    }
    
}