#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> a(n / 2);
  for (auto &x : a) {
    cin >> x;
  };
  sort(a.begin(), a.end());
  int w = 0, b = 0;
  for (int i = 0; i < n / 2; i++) {
    w += abs(a[i] - 2 * i - 1);
    b += abs(a[i] - 2 * i - 2);
  }
  cout << min(w, b) << endl;
}
int main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
}
