#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long i, t, n, odds = 0, evens = 0;
  cin >> n;
  vector<long long> odd(n / 2), even(n / 2), p(n / 2);
  for (i = 0; i < n / 2; i++) cin >> p[i];
  sort(p.begin(), p.end());
  for (i = 0; i < n / 2; i++) {
    odd[i] = i * 2 + 1;
    even[i] = i * 2 + 2;
    odds += abs(p[i] - odd[i]);
    evens += abs(p[i] - even[i]);
  }
  if (odds > evens)
    cout << evens << endl;
  else
    cout << odds << endl;
  return 0;
}
