#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 20;
int n, p[maxn], answ, ansb;
int main() {
  cin >> n;
  for (int i = 0; i < n / 2; i++) cin >> p[i];
  sort(p, p + n / 2);
  for (int i = 0; i < n / 2; i++) ansb += abs(p[i] - (i * 2 + 1));
  for (int i = n / 2 - 1; i >= 0; i--) answ += abs(p[i] - ((i + 1) * 2));
  cout << min(ansb, answ);
  return 0;
}
