#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> vec, ev, od;
int main() {
  cin >> n;
  vec.resize(n / 2);
  for (int i = 0; i < n / 2; ++i) {
    cin >> vec[i];
  }
  sort(vec.begin(), vec.end());
  int ans = 0;
  for (int i = 1, x = 0; i <= n; i += 2, ++x) ans += abs(vec[x] - i);
  int tmp = 0;
  for (int i = 2, x = 0; i <= n; i += 2, ++x) tmp += abs(vec[x] - i);
  cout << min(tmp, ans) << endl;
  return 0;
}
