#include <bits/stdc++.h>
using namespace std;
inline void rvi(vector<unsigned long long>& a) {
  for (unsigned long long i = 0; i < a.size(); ++i) scanf("%llu", &a[i]);
}
inline void rvu(vector<unsigned long long>& a) {
  for (unsigned long long i = 0; i < a.size(); ++i) scanf("%llu", &a[i]);
}
int main() {
  int n;
  cin >> n;
  int best = 10000;
  vector<int> loc(n / 2);
  for (int i = 0; i < n / 2; ++i) cin >> loc[i];
  sort(loc.begin(), loc.end());
  int cur = 2;
  int tot1 = 0;
  for (auto l : loc) {
    tot1 += abs(l - cur);
    cur += 2;
  }
  cur = 1;
  int tot2 = 0;
  for (auto l : loc) {
    tot2 += abs(l - cur);
    cur += 2;
  }
  cout << min(tot1, tot2) << endl;
}
