import java.util.Scanner;
import java.util.Arrays;

public class ICPC0528 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int size = in.nextInt();
		int [] positions = new int[size/2];
		
		Arrays.sort(positions);
		
		for(int i = 0;i<positions.length;i++){
			positions[i]=in.nextInt()-1;
		}
		
		int blackMoves = 0;
		int whiteMoves = 0;
		
		for(int i = 0; i<positions.length;i++){
			//index of left-most available black will be 2i
			//index of left-most available white will be 2i+1
			//index of left-most placed will be positions[i] because they're being moved 
			blackMoves += Math.abs(2*i - positions[i]);
			whiteMoves += Math.abs((2*i+1)-positions[i]);
			//System.out.println(Math.abs(2*i - positions[i]));
		}
		//System.out.println(blackMoves);
		//System.out.println(whiteMoves);
		if(blackMoves<whiteMoves || blackMoves == whiteMoves){
			System.out.println(blackMoves);
		}
		else{
			System.out.println(whiteMoves);
		}
		
		
		
	}

}
