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

public class Main{
	public static void main (String[] args) throws java.lang.Exception{
		Scanner sc = new Scanner( System.in );
		int n = sc.nextInt();
		int positions [] = new int[ n/2 ];
		int lw, lb, wm, bm, i, j;
		wm = bm = 0;
		
		lw = 1; lb = n + 2;
		
		for( i = 0; i < n/2; i++){
			positions[i] = sc.nextInt();
		}
		
		Arrays.sort( positions );
		
		for( i = 0, j = ( n / 2 ) - 1; i < n/2; i++, j-- ){
			lw += 2;
			lb -= 2;
			wm += Math.abs( positions[i] - lw );
			bm += Math.abs( positions[j] - lb );
		}
		
		System.out.println( Math.min( wm, bm ) );
	}
}