

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 sum=0,sumo=0,sume=0;
        for (int i = 0; i < x/2; i++) {
            numbers[i]=in.nextInt();
            if (numbers[i]%2==0) {
                sume++;
            }else sumo++;
}
        
        Arrays.sort(numbers);
        
         if (sume<=sumo) {
            for (int i = 0,j=1; i < x/2;j+=2, i++) {
                sum+=Math.abs(numbers[i]-j);
            }
        }
        else {
            for (int i = 0,j=2; i < x/2;j+=2, i++) {
                sum+=Math.abs(numbers[i]-j);
            }}
            System.out.println(sum);
        

    }
    
}
