#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VL = vector<LL>;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;
void dout() { cerr << endl; }
template <typename Head, typename... Tail>
void dout(Head H, Tail... T) {
  cerr << H << ' ';
  dout(T...);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  VI p(n / 2);
  for (int i = (0); i < (n / 2); ++i) cin >> p[i];
  sort(p.begin(), p.end());
  int ans = 447447;
  int cur = 0;
  for (int i = (0); i < (n / 2); ++i) cur += abs(p[i] - (2 * i + 1));
  ans = min(ans, cur);
  cur = 0;
  for (int i = (0); i < (n / 2); ++i) cur += abs(p[i] - (2 * i + 2));
  ans = min(ans, cur);
  cout << ans;
  return 0;
}
