#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[50], e = 0, o = 0;
  cin >> n;
  for (int i = 0; i < n / 2; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 1; i < n; i += 2) {
    o += abs(i - a[i / 2]);
    e += abs(i + 1 - a[i / 2]);
  }
  cout << min(o, e);
}
