import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Task985A {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        new Task985A().solve(in, out);
        out.close();
    }

    public void solve(InputReader in, PrintWriter out) {
        int n = in.nextInt();
        int ans0 = 0;
        int ans1 = 0;
        int p0 = 0;
        int p1 = 1;

        int data[] = new int[n / 2];
        for (int i = 0; i < n / 2; i++) {
            data[i] = in.nextInt() - 1;
        }
        Arrays.sort(data);
        for (int i = 0; i < n / 2; i++) {
            int x = data[i];
            ans0 += Math.abs(x - p0);
            p0 += 2;
            ans1 += Math.abs(x - p1);
            p1 += 2;
        }
        out.println(Math.min(ans0, ans1));
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public int nextChar() {
            return next().charAt(0);
        }
    }
}