import java.util.*;
//import 
public class CF985A {
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int n = scn.nextInt();
        int hold [] = new int[n/2];
        for(int i=0;i<n/2;i++){
            hold[i] = scn.nextInt();
        }
        Arrays.sort(hold);
        int count1=0,count2=0;
        for(int i=0;i<n/2;i++){
            count1+= Math.abs(hold[i]-((i*2)+1));
            count2+= Math.abs(hold[i]-((i*2)+2));
        }
        System.out.println(Math.min(count1,count2));
    }
    
}
