import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.PrintWriter;

public class Main {

    public static void main(String[]args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        int N = Integer.parseInt(br.readLine());
        StringTokenizer st = new StringTokenizer(br.readLine());
        int[] pos = new int[N / 2];
        for (int i = 0; i < N / 2; i++) {
            pos[i] = Integer.parseInt(st.nextToken())-1;
        }
        int maxi = 0;
        for (int i = 0; i < pos.length; i++) {
            maxi += Math.abs(pos[i] - 2*i);
        }
        int diff = 0;
        for (int i = 0; i < pos.length; i++) {
            diff += Math.abs(pos[i] - 2*(i+1));
        }
        pw.println(Math.min(maxi, diff));
        pw.flush();
    }

    public static void debug(Object...args) {
        System.out.println(Arrays.deepToString(args));
    }
}
