#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64777216")
using namespace std;
const int inf = (int)1e9 + 5;
const long long INF = (long long)1e18 + 5;
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n / 2);
  for (long long i = 0; i < n / 2; i++) cin >> a[i];
  sort(a.begin(), a.end());
  long long ans = INF;
  for (long long start = 0; start < 2; start++) {
    long long cur_ans = 0;
    for (long long i = 0; i < n / 2; i++) {
      long long cur = start + i * 2;
      cur_ans += abs((a[i] - 1) - cur);
    }
    ans = min(ans, cur_ans);
  }
  cout << ans << endl;
}
int main() {
  string filename = "acm";
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(15);
  solve();
  (void)0;
  return 0;
}
