#include <bits/stdc++.h>
using namespace std;
int main() {
  int br[110], wr[110];
  int n;
  while (cin >> n) {
    int i, j, k, l, cnt = 0, cnt1 = 0;
    for (i = 0; i < n / 2; i++) {
      cin >> l;
      br[i] = l;
      wr[i] = l;
    }
    l = n / 2;
    sort(br, br + l);
    sort(wr, wr + l);
    k = 1;
    for (i = 0; i < l; i++) {
      if (br[i] != k) cnt += abs(k - br[i]);
      k += 2;
    }
    k = 2;
    for (i = 0; i < l; i++) {
      if (wr[i] != k) cnt1 += abs(k - wr[i]);
      k += 2;
    }
    cout << min(cnt, cnt1) << endl;
  }
  return 0;
}
