import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {

    public static void main(String[] args) {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
        Scanner s=new Scanner(System.in);
        int n=s.nextInt();
        int[] arr=new int[n/2];
        int sum=0;
        for(int i=0;i<n/2;i++){
        	arr[i]=s.nextInt();
        	sum+=arr[i];
        }
        Arrays.sort(arr);
        // case 1 - all to white.
        int b=0;
        int idx=0;
        for(int i=1;i<=n;i+=2){
        	//System.out.println(i+" "+arr[idx]);
        	b+=Math.abs(i-arr[idx++]);
        	//System.out.println(i+" "+n+" s");
        }
        //System.out.println(b);
        int w=0;
        idx=0;
        for(int i=2;i<=n;i+=2){
        	w+=Math.abs(i-arr[idx++]);
        }
        //System.out.println(w);
        System.out.println(Math.min(w, b));
    }
}