#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, k, l, a, b, c, n, g, f;
  cin >> n;
  vector<long long> arr;
  for (i = 0; i < n / 2; i++) {
    cin >> l;
    arr.push_back(l);
  }
  sort(arr.begin(), arr.end());
  long long coun = 0, poun = 0;
  for (i = 1; i <= n / 2; i++) {
    j = 2 * i;
    coun += (abs(j - arr[i - 1]));
  }
  for (i = 1; i <= n / 2; i++) {
    j = (2 * i) - 1;
    l = (abs(j - arr[i - 1]));
    poun += l;
  }
  cout << min(coun, poun) << endl;
  return 0;
}
