#include <bits/stdc++.h>
using namespace std;
int n, i;
vector<int> v, w, b;
int main() {
  ios_base::sync_with_stdio(false);
  ;
  cin >> n;
  for (i = 1; i <= n; i++) {
    if (i % 2)
      w.push_back(i);
    else
      b.push_back(i);
  }
  for (i = 0; i < n / 2; i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  sort(v.begin(), v.end());
  int ans1 = 0, ans2 = 0;
  for (i = 0; i < n / 2; i++) {
    ans1 += abs(w[i] - v[i]);
    ans2 += abs(b[i] - v[i]);
  }
  cout << min(ans1, ans2);
  return 0;
}
