You are given a chessboard of size 1 × n. It is guaranteed that n is even. The chessboard is painted like this: "BWBW...BW".

Some cells of the board are occupied by the chess pieces. Each cell contains no more than one chess piece. It is known that the total number of pieces equals to <image>.

In one step you can move one of the pieces one cell to the left or to the right. You cannot move pieces beyond the borders of the board. You also cannot move pieces to the cells that are already occupied.

Your task is to place all the pieces in the cells of the same color using the minimum number of moves (all the pieces must occupy only the black cells or only the white cells after all the moves are made).

Input

The first line of the input contains one integer n (2 ≤ n ≤ 100, n is even) — the size of the chessboard. 

The second line of the input contains <image> integer numbers <image> (1 ≤ pi ≤ n) — initial positions of the pieces. It is guaranteed that all the positions are distinct.

Output

Print one integer — the minimum number of moves you have to make to place all the pieces in the cells of the same color.

Examples

Input

6
1 2 6


Output

2


Input

10
1 2 3 4 5


Output

10

Note

In the first example the only possible strategy is to move the piece at the position 6 to the position 5 and move the piece at the position 2 to the position 3. Notice that if you decide to place the pieces in the white cells the minimum number of moves will be 3.

In the second example the possible strategy is to move <image> in 4 moves, then <image> in 3 moves, <image> in 2 moves and <image> in 1 move.
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());
        }

    }
}