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