#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long arr[n / 2];
  long long d = n / 2;
  for (long long i = 0; i < d; i++) cin >> arr[i];
  long long mini = 1e10;
  sort(arr, arr + d);
  long long ans = 0;
  long long co = 0;
  for (long long i = 1; i <= n; i += 2) {
    ans += abs(i - arr[co++]);
  }
  mini = min(mini, ans);
  ans = 0;
  co = 0;
  for (long long i = 2; i <= n; i += 2) {
    ans += abs(i - arr[co++]);
  }
  mini = min(mini, ans);
  cout << mini << endl;
}
