#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> v(n / 2);
  for (int& i : v) {
    cin >> i;
  }
  sort(begin(v), end(v));
  int b_d = 0, w_d = 0;
  for (int i = 0; i < n / 2; i++) {
    b_d += abs(v[i] - (i * 2 + 1));
    w_d += abs(v[i] - (i * 2 + 2));
  }
  cout << min(b_d, w_d) << endl;
  return 0;
}
