#include <bits/stdc++.h>
using namespace std;
int n, a;
vector<int> arr1, arr2;
int main() {
  int costOdd = 0, costEven = 0;
  cin >> n;
  for (int i = 0; i < n / 2; i++) {
    cin >> a;
    arr1.push_back(a);
    arr2.push_back(a);
  }
  sort(arr1.begin(), arr1.end());
  sort(arr2.begin(), arr2.end());
  for (int i = n - 1; i >= 1; i -= 2) {
    costOdd += abs(i - arr1.back());
    arr1.pop_back();
  }
  for (int i = n; i >= 1; i -= 2) {
    costEven += abs(i - arr2.back());
    arr2.pop_back();
  }
  printf("%d\n", min(costOdd, costEven));
  return 0;
}
