#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n / 2];
  for (int i = 0; i < n / 2; i++) {
    cin >> a[i];
  }
  sort(a, a + n / 2);
  int black = 0;
  int i = 0, j = 0;
  while (i < n / 2) {
    black += abs(n - j - 1 - a[n / 2 - i - 1]);
    i += 1;
    j += 2;
  }
  int white = 0;
  i = 0, j = 0;
  while (i < n / 2) {
    white += abs(n - j - a[n / 2 - i - 1]);
    i += 1;
    j += 2;
  }
  cout << min(black, white);
  return 0;
}
