#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l = 0, r = 0;
  cin >> n;
  vector<int> v(n / 2);
  for (int i = 0; i < n / 2; ++i) cin >> v[i];
  sort(v.begin(), v.end());
  for (int i = 0; i < n / 2; ++i) {
    l += abs((i * 2 + 2) - v[i]);
    r += abs((i * 2 + 1) - v[i]);
  }
  cout << min(l, r);
}
