#include <bits/stdc++.h>
using namespace std;
long long n, x[102], ans1, ans2, cnt;
int main() {
  cin >> n;
  n /= 2;
  for (int i = 0; i < n; i++) cin >> x[i];
  sort(x, x + n);
  cnt = 0;
  for (int i = 1; i <= 2 * n; i += 2) {
    if (x[cnt] != i) ans1 += abs(i - x[cnt]);
    cnt++;
  }
  cnt = 0;
  for (int i = 2; i <= 2 * n; i += 2) {
    if (x[cnt] != i) ans2 += abs(x[cnt] - i);
    cnt++;
  }
  cout << min(ans1, ans2) << "\n";
  return 0;
}
