#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n / 2; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + (n / 2));
  int ans = INT_MAX;
  int temp = 0;
  for (int i = 1, j = 0; i < n; i += 2, j++) {
    temp += abs(i - arr[j]);
  }
  ans = min(ans, temp);
  temp = 0;
  for (int i = 2, j = 0; i <= n; i += 2, j++) {
    temp += abs(i - arr[j]);
  }
  ans = min(ans, temp);
  cout << ans << endl;
  return 0;
}
