#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  vector<long long int> v(n / 2 + 1, 0);
  v[0] = -1e16;
  for (long long int i = 1; i <= n / 2; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  long long int minnw = 1e17, val = 0, minusval = n;
  for (long long int i = n / 2; i >= 1; i--) {
    val += abs(minusval - v[i]);
    minusval -= 2;
  }
  minnw = min(minnw, val);
  val = 0;
  minusval = n - 1;
  for (long long int i = n / 2; i >= 1; i--) {
    val += abs(minusval - v[i]);
    minusval -= 2;
  }
  minnw = min(minnw, val);
  cout << minnw << endl;
  return 0;
}
