import java.util.Scanner;

public class Solution {


    public static void main(String[] args) {


        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();

        n = n / 2;

        int[] arr = new int[n];

        for (int i = 0; i < n; i++) {
            arr[i] = scan.nextInt();
        }

        int b = 0;
        int w = 0;

        int c = 0;

        for (int i = 0; i < n; i++) {
            c++;
            b += Math.abs(arr[i] - c);
            c++;
            w += Math.abs(arr[i] - c);

        }

        if (w < b) {
            System.out.println(w);
        } else System.out.println(b);


    }

}