#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  while (cin >> n) {
    n >>= 1;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    vector<int> b(n), w(n);
    int pos1 = 1, pos2 = 2;
    for (int i = 0; i < n; i++, pos1 += 2, pos2 += 2) {
      b[i] = pos1;
      w[i] = pos2;
    }
    int an1 = 0, an2 = 0;
    sort(a.begin(), a.end());
    for (int i = 0; i < n; i++) {
      an1 += abs(a[i] - b[i]);
      an2 += abs(a[i] - w[i]);
    }
    cout << min(an1, an2) << endl;
  }
  return 0;
}
