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

public class a {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] board = new int[n / 2];
		for (int i = 0; i < n / 2; i++) {
			board[i] = scan.nextInt()-1;
		}
		int odd = 0;
		int even = 0;

		Arrays.sort(board);
		for (int i = 0; i < board.length; i++) {
			odd += Math.abs(board[i] - i*2);
		}
		for (int i = 0; i < board.length; i++) {
			even += Math.abs(board[i] - (i*2 + 1));
		}
		System.out.println(Math.min(odd, even));

	}

}
