import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.Writer;
import java.util.Scanner;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyInputReader in = new MyInputReader(inputStream);
        MyOutputWriter out = new MyOutputWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, MyInputReader in, MyOutputWriter out) {
            int n = in.nextInt();
            int[] places = in.nextIntArray(n / 2);
            Arrays.sort(places);
            // test first
            int sum1 = 0;
            int sum2 = 0;
            for (int i = 0; i < n / 2; ++i) {
                sum1 += Math.abs(places[i] - 2 * i - 1);
                sum2 += Math.abs(places[i] - 2 * (i + 1));
            }
            out.print(Math.min(sum1, sum2) + "");
        }

    }

    static class MyInputReader {
        private Scanner scanner;
        private BufferedReader reader;

        public MyInputReader(InputStream in) {
            this.reader = new BufferedReader(new InputStreamReader(in), 1000000);
            this.scanner = new Scanner(reader);
        }

        public int nextInt() {
            return this.scanner.nextInt();
        }

        public int[] nextIntArray(int n) {
            int[] res = new int[n];
            for (int i = 0; i < n; ++i) {
                res[i] = this.scanner.nextInt();
            }
            return res;
        }

    }

    static class MyOutputWriter {
        private PrintWriter writer;

        public MyOutputWriter(OutputStream out) {
            this.writer = new PrintWriter(out);
        }

        public MyOutputWriter(Writer w) {
            this.writer = new PrintWriter(w);
        }

        public void print(String s) {
            this.writer.print(s);
        }

        public void close() {
            this.writer.close();
        }

    }
}

