import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

import static java.lang.Math.abs;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = sc.nextInt();
        int sum1=0,sum2=0;
        int counter=1;
        int halfN = n/2;
        int arr[] = new int[halfN];
        for (int i = 0; i < halfN; i++) {
            arr[i]=sc.nextInt();
        }
        Arrays.sort(arr);
        for (int a :arr) {
            sum1 += abs(counter-a);
            sum2 += abs(counter-a+1);
            counter+=2;
        }

        out.print(Integer.min(sum1,sum2));
        out.close();

    }
}