#include <bits/stdc++.h>
using namespace std;
int flag[100 + 10], n;
int main() {
  int x;
  ios_base::sync_with_stdio(false);
  cin >> n;
  vector<int> vc;
  for (int i = 0; i < n / 2; i++) {
    cin >> x;
    vc.push_back(x);
  }
  sort(vc.begin(), vc.end());
  int ans1 = 0, ans2 = 0;
  for (int i = vc.size() - 1; i >= 0; i--) {
    int j = i + 1;
    ans1 += abs(2 * j - vc[i]);
    ans2 += abs(2 * j - 1 - vc[i]);
  }
  cout << min(ans1, ans2) << endl;
}
