#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int p[n / 2];
  for (int i = 0; i < n / 2; i++) cin >> p[i];
  sort(p, p + n / 2);
  int res = 0, pos = 1;
  for (int i = 0; i < n / 2; i++) {
    res = res + abs(p[i] - pos);
    pos += 2;
  }
  int res2 = 0;
  pos = 2;
  for (int i = 0; i < n / 2; i++) {
    res2 = res2 + abs(p[i] - pos);
    pos += 2;
  }
  if (res <= res2)
    cout << res;
  else
    cout << res2;
}
