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