import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] pos = new int[n/2];
        for (int i = 0; i < pos.length; i++) pos[i] = scanner.nextInt();
        Arrays.sort(pos);
        int sum1 = 0, sum2 = 0;
        for (int i = 0; i < pos.length; i++) {
            sum1 += Math.abs((i*2+1) - pos[i]);
        }
        for (int i = 0; i < pos.length; i++) {
            sum2 += Math.abs((i*2+2) - pos[i]);
        }
        System.out.println(Math.min(sum1, sum2));
    }
}