#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d;
  cin >> a;
  c = d = 0;
  int e, f;
  e = 1;
  f = 2;
  vector<int> r;
  for (int i = 0; i < (a / 2); ++i) {
    cin >> b;
    r.push_back(b);
  }
  sort(r.begin(), r.end());
  for (int i = 0; i < (a / 2); ++i) {
    c += abs(e - r[i]);
    d += abs(f - r[i]);
    e += 2;
    f += 2;
  }
  cout << min(c, d) << endl;
  return 0;
}
