#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 + 10;
int p[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < int(n / 2); i++) cin >> p[i];
  sort(p, p + n / 2);
  int c1 = 0, c2 = 0;
  for (int i = 0; i < int(n / 2); i++) {
    c1 += abs(p[i] - (2 * i + 1));
    c2 += abs(p[i] - 2 * (i + 1));
  }
  cout << min(c1, c2) << '\n';
  return 0;
}
