import java.util.*;

/**
 * Created by zouyiran on 2017/8/8.
 */

public class Main {

    public static void main(String[] args){
        
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(),res1=0,res2=0;
        int[] a = new int[101];
        for(int i=0;i<n/2;i++){
            a[i]=in.nextInt();
        }
        Arrays.sort(a);
        for(int i=0;i<n/2;i++){
            int x=a[i];
            res1+=Math.abs(i*2+1-x);
            res2+=Math.abs(i*2+2-x);
        }
        System.out.println(Math.min(res1,res2));
    }
}
