#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const double PI = 2 * acos(0.0);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int arr[n / 2];
  for (int i = 0; i < n / 2; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n / 2);
  long long cost1 = 0, cost2 = 0, tmp;
  for (int i = 0; i < n / 2; i++) {
    tmp = i + 1;
    cost1 += abs(arr[i] - 2 * tmp + 1);
    cost2 += abs(arr[i] - 2 * tmp);
  }
  cout << min(cost1, cost2) << "\n";
  return 0;
}
