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

public class codeforces {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            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;
        }
    }

    public static void main(String[] args) {
        FastReader in = new FastReader();OutputStream outputStream = System.out;PrintWriter out = new PrintWriter(outputStream);
        int n =in.nextInt();
        int e=2;int o=1;int es=0;int os=0;int[] arr = new int[n/2];
        for (int i=0;i<n/2;i++) arr[i]=in.nextInt();Arrays.sort(arr);
        for (int i=0;i<n/2;i++){
            int t = arr[i];
            os+=Math.abs(o-t);o+=2;
            es+=Math.abs(e-t);e+=2;
        }
        out.print((int)Math.min(os,es));
        out.close();
    }
}