import java.util.*;


public class Codeforces985A {

	public int solve(int n, int[] positions) {
		int oddDifference = 0;
		for (int i = 0; i < positions.length; i++) {
			oddDifference += Math.abs(2 * i + 1 - positions[i]);
		}
		
		int evenDifference = 0;
		for (int i = 0; i < positions.length; i++) {
			evenDifference += Math.abs(2 * i + 2 - positions[i]);
		}
		return Math.min(oddDifference, evenDifference);
	}
	
	public static void main(String[] argv) {
		Scanner scanner = new Scanner(System.in);
		Codeforces985A codeforces985A = new Codeforces985A();
		
		int n = scanner.nextInt();
		int[] positions = new int[n / 2];
		for (int i = 0; i < positions.length; i++) {
			positions[i] = scanner.nextInt();
		}
		Arrays.sort(positions);
		int result = codeforces985A.solve(n, positions);
		
		System.out.println(result);
	}
}