#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];
  for (int i = 0; i < n / 2; ++i) {
    cin >> a[i];
  }
  int cnt1 = 0, cnt2 = 0;
  sort(a, a + (n / 2));
  for (int i = 0; i < n / 2; ++i) {
    cnt1 += abs(a[i] - (2 * i + 1));
  }
  for (int i = 0; i < n / 2; ++i) {
    cnt2 += abs(a[i] - (2 * (i + 1)));
  }
  cout << min(cnt1, cnt2) << endl;
  return 0;
}
