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

public class A {

    static Scanner in = new Scanner(new BufferedInputStream(System.in));
    public static void main(String[] args) {
        while(in.hasNext()){
            work();
        }

    }

    private static void work() {
        int n = in.nextInt();
        int len = n/2;
        int []pos = new int[len];
        for(int i=0; i<len; i++){
            pos[i] = in.nextInt();
        }
        Arrays.sort(pos);
        int end = n;
        int ans1=0, ans2=0;
        for(int i=len-1; i>=0; i--){
            ans1 += Math.abs(end-pos[i]);
            end-=2;
            if(end<=0)break;
           // System.out.println(ans1);
        }
        end = n-1;
        for (int i=len-1; i>=0 ; i--) {
            ans2 += Math.abs(end-pos[i]);
            end-=2;
            if(end<=0)break;
           // System.out.println(ans2);
        }
        System.out.println(Math.min(ans1, ans2));
    }

}
