//package codeforces.educational_r_44_985;

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

public class A {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] positions = new int[n];


        for (int i = 0; i < n/2; i++) {
            positions[i] = scanner.nextInt();
        }
        Arrays.sort(positions);
        int totalMoves = 0;
        int index = 0;
        for (int i = 1; i <n ; i+=2) {
            if (positions[index]!=i) {
                totalMoves += Math.abs(positions[index] - i);
            }
            index++;
        }
        int minMoves = totalMoves;
        totalMoves = 0;
        index = n/2-1;
        for (int i = n; i >=2 ; i-=2) {
            if (positions[index]!=i) {
                totalMoves += Math.abs(i-positions[index]);
            }
            index--;
        }
        minMoves = Math.min(minMoves, totalMoves);
        System.out.println(minMoves);
    }
}
