#include <bits/stdc++.h>
using namespace std;
using i64 = long long int;
using ii = pair<int, int>;
using ii64 = pair<i64, i64>;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> pos(n);
  for (int i = 0; i < n / 2; i++) scanf("%d", &pos[i]);
  sort(pos.begin(), pos.end());
  int white = 0, black = 0;
  for (int i = 0; i < n / 2; i++) {
    int wp = i * 2 + 1, bp = (i + 1) * 2;
    white += abs(pos[i] - wp);
    black += abs(pos[i] - bp);
  }
  printf("%d", min(white, black));
  return 0;
}
