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