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