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

public class CF985A {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int[] arr = new int[n/2];
        HashMap<Integer,Boolean > map = new HashMap<>();
//        int[] bool = new int[n/2];
        for (int i = 0; i < n/2; i++) {
            arr[i] = s.nextInt()-1;
            map.put(arr[i],true);
        }
        int j = 0;
        int ans1 = 0;
//        int count = 0;
//        Arrays.fill(bool,Integer.MIN_VALUE);
        Arrays.sort(arr);
        for (int i = 0;i<n/2;i++){
//            if(i % 2 != 0 && !map.containsKey(i)){
//                count++;
//                bool[j++] = i;
//            }
            ans1 += Math.abs(j-arr[i]);
            j += 2;
        }
        int count = 0;
        j = 1;
        for (int i = 0; i < n/2; i++) {
//            if(arr[i] % 2 == 0){
//                int c = findClosest(bool,arr[i]);
                count += Math.abs(j-arr[i]);
                j +=2;
//            }
        }
        System.out.println(Math.min(ans1,count));



    }

    public static int findClosest(int arr[], int target)
    {
        int n = arr.length;

        // Corner cases
        if (target <= arr[0])
            return arr[0];
        if (target >= arr[n - 1])
            return arr[n - 1];

        // Doing binary search
        int i = 0, j = n, mid = 0;
        while (i < j) {
            mid = (i + j) / 2;

            if (arr[mid] == target)
                return arr[mid];

            /* If target is less than array element,
               then search in left */
            if (target < arr[mid]) {

                // If target is greater than previous
                // to mid, return closest of two
                if (mid > 0 && target > arr[mid - 1])
                    return getClosest(arr[mid - 1],
                            arr[mid], target);

                /* Repeat for left half */
                j = mid;
            }

            // If target is greater than mid
            else {
                if (mid < n-1 && target < arr[mid + 1])
                    return getClosest(arr[mid],
                            arr[mid + 1], target);
                i = mid + 1; // update i
            }
        }

        // Only single element left after search
        return arr[mid];
    }

    // Method to compare which one is the more close
    // We find the closest by taking the difference
    //  between the target and both values. It assumes
    // that val2 is greater than val1 and target lies
    // between these two.
    public static int getClosest(int val1, int val2,
                                 int target)
    {
        if (target - val1 >= val2 - target)
            return val2;
        else
            return val1;
    }

    /*private static int getEvenPos(int[] arr, boolean[] clone) {
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] % 2 == 0){
                clone[arr[i]] = false;
            }
            int count1=1;
            int k = arr[i]-1;
            boolean bool = false;
            while(k >= 0){
                if(!clone[k]){

                    count1 += 2;
                    bool = true;
                    break;
                }
                k = k-2;
            }
            if(!bool){
                count1 = Integer.MAX_VALUE;
            }
            k = arr[i]+1;
            int count2 = 1;
            bool = false;
            while(k < clone.length){
                if(!clone[k]){

                    count2 += 2;
                    bool = true;
                    break;
                }
                k = k+2;
            }
            if(!bool){
                count2 = Integer.MAX_VALUE;
            }
            if(count1 <= count2){
                clone[arr[i] - count1 - 1] = true;
                count = count + count1;
            }else{
                clone[arr[i] + count2 + 1] = true;
                count = count + count2;
            }
        }
        return count;
    }

    private static int getOddPos(int[] arr, boolean[] clone) {
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] % 2 != 0){
                clone[arr[i]] = false;
            }
            int count1=1;
            int k = arr[i]-1;
            boolean bool = false;
            while(k >= 0){
                if(!clone[k]){

                    count1 += 2;
                    bool = true;
                    break;
                }
                k = k-2;
            }
            if(!bool){
                count1 = Integer.MAX_VALUE;
            }
            k = arr[i]+1;
            int count2 = 1;
            bool = false;
            while(k < clone.length){
                if(!clone[k]){

                    count2 += 2;
                    bool = true;
                    break;
                }
                k = k+2;
            }
            if(!bool){
                count2 = Integer.MAX_VALUE;
            }
            if(count1 <= count2){
                clone[arr[i] - count1 - 1] = true;
                count = count + count1;
            }else{
                clone[arr[i] + count2 + 1] = true;
                count = count + count2;
            }
        }
        return count;
    }*/
}
