#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/STAcK:336777216")
using namespace std;
long long int INF = 1e9 + 337;
int main(int argc, const char* argv[]) {
  {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  }
  int n;
  int mans1, mans2;
  cin >> n;
  vector<int> a(n / 2);
  for (int i = 0; i < n / 2; ++i) cin >> a[i];
  sort(a.begin(), a.end());
  mans1 = mans2 = 0;
  for (int i = 0; i < n / 2; ++i) {
    mans1 += abs(a[i] - (i * 2 + 1));
    mans2 += abs(a[i] - (i * 2 + 2));
  }
  cout << min(mans1, mans2);
  cout << endl;
}
