#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int n, m;
int a[MAXN];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n / 2; i++) cin >> a[i];
  sort(a + 1, a + 1 + n / 2);
  int res1 = 0, res2 = 0;
  for (int i = 1, j = 1; i <= n; i += 2, j++) {
    res1 += abs(i - a[j]);
  }
  for (int i = 2, j = 1; i <= n; i += 2, j++) {
    res2 += abs(i - a[j]);
  }
  cout << min(res1, res2) << endl;
  return 0;
}
