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