import java.util.Arrays;
import java.util.Scanner;

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