import java.io.*;
import java.util.*;

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

    static class Solver {
        private void solve(InputReader inp, PrintWriter out) {
            int n = inp.nextInt() / 2, b = 0, w = 0;
            ArrayList<Integer> p = new ArrayList<>(n);
            for (int i = 0; i < n; i++) p.add(inp.nextInt());
            Collections.sort(p);

            int o = 1, e = 2;
            for (Integer a: p) {
                b += Math.abs(a - o);
                w += Math.abs(a - e);
                o += 2;
                e += 2;
            }
            out.print(Math.min(b,w));
        }
    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

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

        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 long nextLong() {
            return Long.parseLong(next());
        }
    }
}