#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 white = 0;
  int index = 2;
  for (int i = 0; i < n / 2; i++) {
    white += abs(index - p[i]);
    index = index + 2;
  }
  int black = 0;
  index = 1;
  for (int i = 0; i < n / 2; i++) {
    black += abs(index - p[i]);
    index = index + 2;
  }
  cout << min(white, black) << "\n";
}
