#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));
  long long minn1 = 0, minn2 = 0;
  int j = 2;
  for (int i = 0; i < n / 2; i++) {
    minn1 += abs(arr[i] - j);
    j += 2;
  }
  j = 1;
  for (int i = 0; i < n / 2; i++) {
    minn2 += abs(arr[i] - j);
    j += 2;
  }
  cout << min(minn1, minn2);
  return 0;
}
