#include <bits/stdc++.h>
using namespace std;
static bool comp(pair<string, long long> &p1, pair<string, long long> &p2) {
  return p1.second < p2.second;
}
int main() {
  long long t;
  t = 1;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> v;
    long long i;
    for (i = 0; i < n / 2; i++) {
      long long f;
      cin >> f;
      v.push_back(f);
    }
    sort(v.begin(), v.end());
    long long white = 0;
    long long black = 0;
    long long next = n;
    for (i = n / 2 - 1; i >= 0; i--) {
      white += abs(next - v[i]);
      next -= 2;
    }
    next = n - 1;
    for (i = n / 2 - 1; i >= 0; i--) {
      black += abs(next - v[i]);
      next -= 2;
    }
    cout << min(white, black) << endl;
  }
}
