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