
import java.util.*;

public class Test {
 public static boolean cheekeven(int []a,int x){
     int sum=0;
            for(int i=0;i<a.length;i++) {
                if (a[i]%2==1) {
                    sum++;
                }
            }
   
       if ((sum==0)) {
         return true;
     }else return false;
     }
 
    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;
        for (int i = 0; i < x/2; i++) {
            numbers[i]=in.nextInt();}
        
        Arrays.sort(numbers);
        
        if (cheekeven(numbers,x)) {
            
        }
        else if (numbers[0]<=x/2) {
            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);
        

    }
    
}
