#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n / 2);
  for (auto& i : v) cin >> i;
  sort(v.begin(), v.end());
  int i;
  int nr_w = 0, nr_b = 0;
  int j = 0;
  for (i = 2; i <= n; i += 2, j++) {
    nr_w += abs(v[j] - i);
  }
  for (j = 0, i = 1; i < n; i += 2, j++) {
    nr_b += abs(v[j] - i);
  }
  cout << min(nr_w, nr_b) << endl;
  return 0;
}
