
import java.util.*;

public class Test {

 
    public static void main(String[] args) {
       
Scanner in=new Scanner(System.in);
int x=in.nextInt();
int[]numbers=new int[x/2];
int sumo=0,sume=0;
        for (int i = 0; i < x/2; i++) {
            numbers[i]=in.nextInt();
            
}
        
        Arrays.sort(numbers);
        
        
            for (int i = 0,j=1; i < x/2;j+=2, i++) {
                sumo+=Math.abs(numbers[i]-j);
            }
       
            for (int i = 0,j=2; i < x/2;j+=2, i++) {
                sume+=Math.abs(numbers[i]-j);
            }if (sumo>sume) {
                        System.out.println(sume);

        }else
            System.out.println(sumo);
        

    }
    
}
