import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class A {

	public static Scanner scan = new Scanner(System.in);
	public static BufferedReader stdin;
	public static PrintWriter out;
	
	public static void main(String[] args) throws IOException {
		stdin = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		
		int n = scan.nextInt();
		
		int[] board = new int[n/2];
		
		for (int i=0; i<n/2; i++) {
			board[i] = scan.nextInt()-1;
		}
		Arrays.sort(board);
		
		int oddAns = 0;
		int evenAns = 0;
		
		for (int i=0; i<board.length; i++) {
			oddAns += Math.abs(board[i] - i*2);
		}
		for (int i=0; i<board.length; i++) {
			evenAns += Math.abs(board[i] - (i*2+1));
			//System.out.println(board[i] + " " + (i*2+1));
		}
		System.out.println(Math.min(oddAns, evenAns));
		stdin.close();
		out.close();
	}

}
