import java.util.*;
import java.io.*;

public class ChessPlacing {
  public static void main(String[] args) throws Exception {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder builder = new StringBuilder();

    int n = new Integer(reader.readLine());
    String[] locationData = reader.readLine().split("\\s+");
    int[] locations = new int[n];
    int bMoves = 0;
    int wMoves = 0;
    for (int i = 0; i < locationData.length; i++) {
      int current = new Integer(locationData[i]);
      int bTarget = (i * 2) + 1;
      int wTarget = (i * 2) + 2;
      bMoves += Math.abs(bTarget - current);
      wMoves += Math.abs(wTarget - current);
    }

    builder.append((int)Math.min(bMoves, wMoves) + "\n");

    System.out.print(builder);
    reader.close();
  }
}
