import java.util.*;
import java.lang.*;
import java.io.*;
public class A_44 {

    public static void main(String[] args) throws IOException {
        BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(b.readLine());
        StringTokenizer s = new StringTokenizer(b.readLine());
        int[] A=new int[(n/2)+1];
        for (int i = 1; i <= n/2; i++) {
            A[i]=Integer.parseInt(s.nextToken());
        }
        Arrays.sort(A, 1, (n/2)+1);
        int sum1=0,sum2=0;
        for (int i = 1; i <=n/2; i++) {
            sum1+=Math.abs((2*i-1)-A[i]);
            sum2+=Math.abs((2*i)-A[i]);
        }
        // for (int i = 1; i <=n; i=i+2) {
        //     sum1+=Math.abs(i-A[(i/2)+1]);
        // }
        // for (int i = 2; i <=n; i=i+2) {
        //     sum2+=Math.abs(i-A[i/2]); 
        // }
        System.out.println(Math.min(sum1,sum2));
    }
}