#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sume = 0, sumo = 0;
  cin >> n;
  int arr[n / 2], arre[n / 2], arro[n / 2];
  for (int i = 0; i < n / 2; i++) scanf("%d", &arr[i]);
  sort(arr, arr + (n / 2));
  for (int i = 0; i < n / 2; i++) {
    arre[i] = (i + 1) * 2;
    arro[i] = arre[i] - 1;
  }
  for (int i = 0; i < n / 2; i++) {
    sume += abs(arre[i] - arr[i]);
    sumo += abs(arro[i] - arr[i]);
  }
  cout << min(sume, sumo) << endl;
  return 0;
}
