#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i;
  cin >> n;
  m = n / 2;
  int pos[m];
  for (i = 0; i < m; i++) cin >> pos[i];
  sort(pos, pos + m);
  int sumodd, sumeve;
  sumodd = sumeve = 0;
  for (i = 0; i < m; i++) {
    sumodd += abs(pos[i] - 2 * i - 1);
    sumeve += abs(pos[i] - 2 * i - 2);
  }
  cout << min(sumodd, sumeve) << endl;
}
