
import java.io.*;
import java.util.*;
import java.util.function.IntUnaryOperator;


/**
 * gl hf
 */
public class Main {
    static class Task {
        PrintWriter out;

        public void solve(MyScanner in, PrintWriter out) {
            this.out = out;

            int n  = in.nextInt();
            int[] pos = new int[n/2];
            for (int i = 0; i < n/2; i++) {
                pos[i] = in.nextInt();
            }

            Arrays.sort(pos);

            int totalBlack = 0;
            int totalWhite = 0;

            for (int i = 0; i < n/2; i++) {
                int wPos = (i + 1) * 2;
                int bPos = wPos - 1;

                totalBlack += Math.abs(bPos - pos[i]);
                totalWhite += Math.abs(wPos - pos[i]);
            }

            System.out.println(Math.min(totalBlack, totalWhite));
/*
            int n = in.nextInt();
            int m = in.nextInt();
            String[] info = new String[n];

            for (int i = 0; i < n; i++) {
                info[i] = in.nextLine();
            }

            int aggregatad[] = new int[m];

            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    if (info[i].charAt(j) == '1') {
                        aggregatad[j]++;
                    }
                }
            }

            for (int i = 0; i < n; i++) {
                boolean can = true;
                for (int j = 0; j < m; j++) {
                    if (info[i].charAt(j) == '1' && aggregatad[j] <= 1) {
                        can = false;
                    }
                }
                if (can) {
                    System.out.println("YES");
                    return;
                }
            }

            System.out.println("NO")*/
            return;
        }

        private void printArray(int[] arr) {
            out.println("Printing arrray of size " + arr.length);
            for (int i = 0; i < arr.length; i++) {
                out.println("Arr[" + i + "] = " + arr[i]);
            }
        }

    }

    public static void main(String[] args) {
        MyScanner in = new MyScanner();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        solver.solve(in, out);
        out.close();
    }

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}