
    import java.io.*;
    import java.text.NumberFormat;
    import java.util.*;

    public class Main {

        public static void main(String[] args) throws IOException {
            InputReader reader = new InputReader(System.in);
            int n = reader.nextInt();
            int length = n/2;
            boolean arr[] = new boolean[n + 1];
            int sumWhite = 0, sumBlack = 0;
            for (int i = 1; i <= length; i++) {
                arr[reader.nextInt()] = true;
            }
            
            int arrNumOdd[] = new int[length];
            int arrIndex1[] = new int[length];
            int j = 0, k = 0;
            for (int i = 1; i < n + 1; i++) {
                if (i % 2 == 0 && arr[i]) {
                    arrNumOdd[j] = i;
                    j++;
                }
                if (i % 2 != 0 && !arr[i]) {
                    arrIndex1[k] = i;
                    k++;
                }
            }
            for (int i = 0; i < length; i++) {
                sumWhite += Math.abs(arrNumOdd[i] - arrIndex1[i]);
            }
            int arrNumEven[] = new int[length];
            int arrIndex2[] = new int[length];
            j = 0; k = 0;
            for (int i = 1; i < n + 1; i++) {
                if (i % 2 != 0 && arr[i]) {
                    arrNumEven[j] = i;
                    j++;
                }
                if (i % 2 == 0 && !arr[i]) {
                    arrIndex2[k] = i;
                    k++;
                }
            }
            for (int i = 0; i < length; i++) {
                sumBlack += Math.abs(arrNumEven[i] - arrIndex2[i]);
            }
            if (sumWhite > sumBlack) {
                System.out.print(sumBlack);
            }else System.out.print(sumWhite);
        }

        static class InputReader {

            StringTokenizer tokenizer;
            BufferedReader reader;
            String token;
            String temp;

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

            public InputReader(FileInputStream stream) {
                tokenizer = null;
                reader = new BufferedReader(new InputStreamReader(stream));
            }

            public String nextLine() throws IOException {
                return reader.readLine();
            }

            public String next() {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    try {
                        if (temp != null) {
                            tokenizer = new StringTokenizer(temp);
                            temp = null;
                        } else {
                            tokenizer = new StringTokenizer(reader.readLine());
                        }

                    } catch (IOException e) {
                    }
                }
                return tokenizer.nextToken();
            }

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

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

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