#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  int i, p[n / 2];
  for (i = 0; i < n / 2; i++) {
    cin >> p[i];
  }
  int min1 = numeric_limits<int>::max();
  int min2 = numeric_limits<int>::max();
  sort(p, p + n / 2, greater<int>());
  int count1 = 0, count2 = 0;
  for (i = 0; i < n / 2; i++) {
    count1 += abs(n - 2 * i - p[i]);
    count2 += abs(n - 2 * i - 1 - p[i]);
  }
  if (count1 < count2)
    cout << count1 << endl;
  else
    cout << count2 << endl;
  return 0;
}
