#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(0);
  cout.tie(0);
  int n, m1 = 0, m2 = 0, i;
  cin >> n;
  int ar[n / 2 + 1];
  for (int i = 1; i <= n / 2; i++) cin >> ar[i];
  ar[0] = 0;
  sort(ar, ar + n / 2 + 1);
  int j = 1;
  for (i = 1; i <= n / 2; i++) {
    m1 = m1 + abs(ar[i] - j);
    j += 2;
  }
  j = 2;
  for (i = 1; i <= n / 2; i++) {
    m2 += abs(ar[i] - j);
    j += 2;
  }
  cout << min(m1, m2) << endl;
}
