#include <bits/stdc++.h>
using namespace std;
long long n, a[112345], cntBlack, cntWhite;
int main() {
  cin >> n;
  for (int i = 1; i <= n / 2; ++i) {
    cin >> a[i];
  }
  sort(a + 1, a + (n / 2) + 1);
  for (int i = 1; i <= n / 2; ++i) {
    cntWhite += abs(a[i] - 2 * i);
  }
  for (int i = 1; i <= n / 2; ++i) {
    cntBlack += abs(a[i] - (2 * i - 1));
  }
  cout << min(cntBlack, cntWhite) << endl;
  return 0;
}
