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