/**
 * @author Finn Lidbetter
 */
import java.util.*;
import java.io.*;
import java.awt.geom.*;

public class TaskA {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder sb = new StringBuilder();
    
    int n = Integer.parseInt(br.readLine());
    String[] s = br.readLine().split(" ");
    int[] arr = new int[n];
    for (int i=0; i<n/2; i++) {
      arr[i] = Integer.parseInt(s[i]);
    }
    int wDist = 0;
    int bDist = 0;
    for (int i=0; i<n/2; i++) {
      wDist += Math.abs(arr[i]-(2*i+1));
      bDist += Math.abs(arr[i]-(2*i+2));
    }
    System.out.println(Math.min(wDist,bDist));
  }
}
