#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int n1 = n / 2;
  int ar[n1];
  for (int i = 0; i < n1; i++) cin >> ar[i];
  sort(ar, ar + n1);
  int a1 = 0, a2 = 0;
  for (int i = 0; i < n1; i++) a1 += abs(2 * i + 1 - ar[i]);
  for (int i = 0; i < n1; i++) a2 += abs(2 * i + 2 - ar[i]);
  cout << min(a1, a2) << endl;
  return 0;
}
