import java.io.*;
import java.util.*;
public class Main {
    static final int N = 110;
    static int[] a = new int[N];
    static int n;

    public static int solve(int x){
        int res=0;
        for(int i=0; i<n/2; ++i){
            res += Math.abs(a[i]-x);
            x += 2;
        }
        return res;
    }

    public static void main(String[] args) {
        Scanner jin = new Scanner(System.in);
        PrintWriter jout = new PrintWriter(System.out);
        n = jin.nextInt();
        for(int i=0; i<n/2; ++i){
            a[i] = jin.nextInt() - 1;
        }
        Arrays.sort(a,0,n/2);
        int ans = Math.min(solve(0), solve(1));
        jout.println(ans);
        jin.close(); jout.close();
    }
}
