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

/**
 * Created by makarfi on 5/21/18.
 */
public class A {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();

        int[] a = new int[n/2];
        for (int i = 0; i < a.length; i++) a[i] = in.nextInt();

        Arrays.sort(a);
        int odd = 0, even = 0;
        for (int i = 0; i < a.length; i++) {
            odd += Math.abs(a[i] - ((i*2)+1));
            even += Math.abs(a[i] - ((i*2)+2));
        }

        System.out.println(Math.min(odd, even));
    }
}
