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