#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int x[n / 2 + 1];
  long long int e = 0, o = 0;
  x[0] = 0;
  for (long long int i = 1; i <= n / 2; i++) {
    cin >> x[i];
  }
  sort(x, x + n / 2 + 1);
  for (long long int i = 1; i <= n / 2; i++) {
    e = e + abs(2 * i - x[i]);
    o = o + abs(2 * i - 1 - x[i]);
  }
  if (e < o)
    cout << e << endl;
  else
    cout << o << endl;
  return 0;
}
