#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int main(void) {
  int v[102];
  int n;
  int x, impar, par;
  cin >> n;
  for (int i = int(0); i < int(n / 2); i++) {
    cin >> v[i];
  }
  sort(v, v + (n / 2));
  impar = par = 0;
  x = 1;
  for (int i = int(0); i < int(n / 2); i++) {
    impar += abs(v[i] - x);
    x += 2;
  }
  x = 2;
  for (int i = int(0); i < int(n / 2); i++) {
    par += abs(v[i] - x);
    x += 2;
  }
  cout << min(par, impar) << endl;
  return 0;
}
