#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  n /= 2;
  vector<int> arr(n);
  int i;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr.begin(), arr.end());
  int ans1 = 0, ans2 = 0;
  int val = 1;
  for (i = 0; i < n; i++) {
    ans1 += abs(val - arr[i]);
    val += 2;
  }
  val = 2;
  for (i = 0; i < n; i++) {
    ans2 += abs(val - arr[i]);
    val += 2;
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}
