#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int a[n / 2], ev = 0;
  for (int i = 0; i < n / 2; ++i) {
    cin >> a[i];
    if (a[i] % 2 == 0) ev++;
  }
  int cnt = 0;
  sort(a, a + (n / 2));
  if (ev <= (n - ev)) {
    for (int i = 0; i < n / 2; ++i) {
      cnt += abs(a[i] - (2 * i + 1));
    }
  } else {
    for (int i = 0; i < n / 2; ++i) {
      cnt += abs(a[i] - (2 * (i + 1)));
    }
  }
  cout << cnt << endl;
  return 0;
}
