import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Arrays;

public class Main {

    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));

        int N = Integer.parseInt(in.readLine());
        String[] line = in.readLine().split(" ");
        int[] p = new int[N/2+1];
        for (int i=1; i<=N/2; ++i) {
            p[i] = Integer.parseInt(line[i-1]);
        }

        Arrays.sort(p);

        int answ = 0;
        for (int i=1, j=1; i<=N/2; ++i, j+=2) {
            answ += Math.max(p[i],j)-Math.min(p[i], j);
        }

        int ansb = 0;
        for (int i=1, j=2; i<=N/2; ++i, j+=2) {
            ansb += Math.max(p[i],j)-Math.min(p[i], j);
        }

        out.write(Math.min(answ, ansb) + "\n");
        in.close();
        out.close();
    }
}
