import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner reader = new Scanner(System.in);
        int n = reader.nextInt();
        int[] s = new int[n];
        int index, odd = 0, enven = 0, cnt = 0;
        for(int i = 0; i < n / 2; i++){
            index = reader.nextInt();
            s[index - 1] = 1;
        }
        for(int i = 0; i < n; i++){
            if(s[i] == 1){
                odd += Math.abs(i - 2 * cnt);
                enven += Math.abs(i - 2 * cnt - 1);
                cnt++;
            }
        }
        if(odd > enven)
            System.out.println(enven);
        else
            System.out.println(odd);

    }
}
