#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[10000], x = 0, ans1 = 0, ans2 = 0, an[1000];
  cin >> n;
  for (int i = 0; i < n / 2; i++) cin >> a[i];
  for (int i = 1; i <= 100; i++) {
    for (int j = 0; j < n / 2; j++) {
      if (a[j] == i) {
        an[x] = a[j];
        x++;
      }
    }
  }
  x = 1;
  for (int i = 0; i < n / 2; i++) {
    ans1 += abs(an[i] - x);
    x += 2;
  }
  x = 2;
  for (int i = 0; i < n / 2; i++) {
    ans2 += abs(an[i] - x);
    x += 2;
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}
