import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class A {

    public static void main(String[] args) {
        FastScanner scanner = new FastScanner();
        int n = scanner.nextInt();
        int[] indexes = new int[n/2];
        for (int i=0; i < n/2; ++i) {
            indexes[i]=scanner.nextInt();
        }
        Arrays.sort(indexes);
        
        int[] even  = new int[n/2];
        for (int k=2, j=0; j<n/2; k+=2, j++) {
            even[j]=k;
        }
        
        int[] noteven  = new int[n/2];
        for (int k=1, j=0; j <n/2; k+=2, j++) {
            noteven[j]=k;
        }

        int a = 0;
        int b = 0;
        for (int i=0; i < indexes.length; ++i) {
            a+=Math.abs(indexes[i]-even[i]);
            b+=Math.abs(indexes[i]-noteven[i]);
        }
        System.out.println(Math.min(a,b));
    }


    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

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