#include <bits/stdc++.h>
using namespace std;
int find_move(vector<int>& digits, bool isOdd) {
  int total = 0;
  int k;
  if (isOdd) {
    k = 1;
    for (int& pos : digits) {
      total += abs(pos - k);
      k += 2;
    }
  } else {
    k = 2;
    for (int& pos : digits) {
      total += abs(pos - k);
      k += 2;
    }
  }
  return total;
}
int main() {
  int n, k;
  vector<int> digits;
  cin >> n;
  for (int i = 0; i < n / 2; ++i) {
    cin >> k;
    digits.push_back(k);
  }
  std::sort(digits.begin(), digits.end());
  cout << min(find_move(digits, true), find_move(digits, false)) << endl;
  return 0;
}
