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