#include <bits/stdc++.h>
using namespace std;
int A[100000];
int abs(int x) {
  if (x < 0) return -1 * x;
  return x;
}
int main() {
  int n, i, sum1 = 0, sum2 = 0;
  cin >> n;
  for (i = 0; i < n / 2; i++) {
    cin >> A[i];
    A[i]--;
  }
  sort(A, A + n / 2);
  int w = n - 1;
  int b = n - 2;
  for (i = n / 2 - 1; i >= 0; i--) {
    sum1 += abs(A[i] - w);
    w -= 2;
    sum2 += abs(A[i] - b);
    b -= 2;
  }
  cout << min(sum1, sum2) << endl;
  return 0;
}
