#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int k, i, n, t, ans, a[60], b[60], x[60];
  for (k = i = 1; i <= 50; i++) {
    a[i] = k++;
    b[i] = k++;
  }
  while (cin >> n) {
    for (i = 1; i <= n / 2; i++) cin >> x[i];
    sort(x + 1, x + n / 2 + 1);
    for (ans = t = 0, i = 1; i <= n / 2; i++) {
      t += fabs(a[i] - x[i]);
      ans += fabs(b[i] - x[i]);
    }
    ans = min(ans, t);
    cout << ans << endl;
  }
  return 0;
}
