#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
const long long MOD = 998244353;
void bugaboo_solver() {
  long long n;
  cin >> n;
  vector<long long> arr(n / 2);
  for (long long i = 0; i < n / 2; i++) cin >> arr[i];
  sort(arr.begin(), arr.end());
  long long cnt = 1;
  long long ans = 0;
  for (long long i = 0; i < n / 2; i++) {
    long long cur = arr[i];
    ans += abs(cur - cnt);
    cnt += 2;
  }
  cnt = 2;
  long long res = 0;
  for (long long i = 0; i < n / 2; i++) {
    long long cur = arr[i];
    res += abs(cur - cnt);
    cnt += 2;
  }
  ans = min(ans, res);
  cout << ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long t = 1;
  for (long long i = 1; i <= t; i++) {
    bugaboo_solver();
    cout << '\n';
  }
}
