#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int half = n / 2;
  vector<int> cheses;
  cheses.resize(half);
  int resToWhite = 0;
  int resToBalck = 0;
  int placeOfNextBlack = 1;
  int placeOfNextWhite = 2;
  for (int i = 0; i < half; ++i) {
    cin >> cheses[i];
  }
  sort(cheses.begin(), cheses.end());
  for (int chese : cheses) {
    resToBalck += abs(chese - placeOfNextBlack);
    resToWhite += abs(chese - placeOfNextWhite);
    placeOfNextBlack += 2;
    placeOfNextWhite += 2;
  }
  int res = (resToBalck > resToWhite) ? resToWhite : resToBalck;
  cout << res << endl;
  return 0;
}
