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