import java.io.*;
import java.util.*;
/**
 *
 * @author Vikash Kumar(vikashkumarbissu)
 * NIT Silchar
 */

public class Main {

    public static Reader in;
    public static PrintWriter out;
    public static long mod = 1000000007;
    public static long inf = 100000000000000000l;
    public static long fac[],inv[];
    public static int union[];
    public static int rank[];

    public static void solve(){
        int n = in.nextInt();
        int[] arr = new int[n / 2];
        for (int i = 0; i < n / 2; i++) {
            arr[i] = in.nextInt();
        }
        int min = Integer.MAX_VALUE;
        Arrays.sort(arr);
        boolean[] visited = new boolean[n+1];
        int count = 0;
        for (int i = 1; i <= n; i += 2) {
            for (int j = 0; j < n / 2; j++) {
                if (!visited[arr[j]]) {
                    count += Math.abs(arr[j] - i);
                    visited[arr[j]] = true;
                    break;
                }
            }
            //out.print(count+" ");
        }
        //out.println();
        min = Math.min(min, count);
        count = 0;
        Arrays.fill(visited, false);
        for (int i = 2; i <= n; i += 2) {
            for (int j = 0; j < n / 2; j++) {
                if (!visited[arr[j]]) {
                    count += Math.abs(arr[j] - i);
                    visited[arr[j]] = true;
                    break;
                }
            }
            //out.print(count+" ");
        }
        //out.println();
        out.println(min > count ? count : min);
        out.close();
    }

    /**
     *  ############################### Template ################################
     */
//    String[] strings = new String[]{"string1", "string2", "string3"};
//    final int[] ints = new int[]{40, 32, 34};
//
//    final List<String> stringList = Arrays.asList(strings);
//        Collections.sort(stringList,
//            (left, right) ->
//    ints[stringList.indexOf(left)] - ints[stringList.indexOf(right)]);


    public static void init() {
        for(int i=0; i<union.length; i++)
            union[i] = i;
    }
    public static int find(int n) {
        return (union[n]==n)?n:(union[n]=find(union[n]));
    }
    public static void unionSet(int i ,int j) {
        if (rank[i] > rank[j]) {
            union[j] = i;
        } else if (rank[j] > rank[i]) {
            union[i] = j;
        } else {
            rank[i]++;
            union[j] = i;
        }
    }
    public static boolean connected(int i,int j) {
        return union[i]==union[j];
    }

    public static long gcd(long a, long b) {
        long x = Math.min(a,b);
        long y = Math.max(a,b);
        while(x!=0) {
            long temp = x;
            x = y%x;
            y = temp;
        }
        return y;
    }

    public static long modPow(long base, long exp, long mod) {
        base = base % mod;
        long result =1;
        while(exp > 0) {
            if(exp % 2== 1) {
                result = (result * base) % mod;
                exp --;
            }
            else {
                base = (base * base) % mod;
                exp = exp >> 1;
            }

        }
        return result;
    }

    public static void cal() {
        fac = new long[1000005];
        inv = new long[1000005];
        fac[0]=1;
        inv[0]=1;
        for(int i=1; i<=1000000; i++) {
            fac[i]=(fac[i-1]*i)%mod;
            inv[i]=(inv[i-1]*modPow(i,mod-2,mod))%mod;
        }
    }
    public static long ncr(int n, int r) {
        return (((fac[n]*inv[r])%mod)*inv[n-r])%mod;
    }


    Main() throws IOException {
        in = new Reader(new InputStreamReader(System.in));
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solve();
        out.flush();
        out.close();
    }

    public static void main(String args[]) {
        new Thread(null, new Runnable() {
            public void run() {
                try {
                    new Main();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }, "1", 1 << 26).start();
    }

    public static class Reader {
        public BufferedReader reader;
        public StringTokenizer st;

        public Reader(InputStreamReader stream) {
            reader = new BufferedReader(stream);
            st = null;
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
        public String nextLine() throws IOException{
            return reader.readLine();
        }
        public long nextLong(){
            return Long.parseLong(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }

    }
}