import java.util.*;
public class chess_pieces {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] piece = new int[n/2+1];
        for(int i=1; i<=n/2; i++)
            piece[i] = in.nextInt();
        int[] white = new int[n/2+1];
        int[] black = new int[n/2+1];
        for(int i=1; i<=n/2; i++) {
            white[i] = 2*i;
            black[i] = 2*i - 1;
        }
        int sum1 = 0, sum2 = 0;
        for(int i=1; i<=n/2; i++) {
            sum1 += Math.abs(white[i] - piece[i]);
            sum2 += Math.abs(black[i] - piece[i]);
        }
        System.out.println(Math.min(sum1, sum2));
    }
}