#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3c3c3c3c;
const long long infl = 0x3c3c3c3c3c3c3c3c;
const int MAX_N = 109;
int p[MAX_N];
int used[MAX_N];
int main() {
  cin.tie(NULL);
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n / 2; i++) {
    cin >> p[i];
    used[p[i]] = true;
  }
  sort(p, p + n / 2);
  vector<int> vec[2];
  for (int i = 0; i < n / 2; i++) {
    if (p[i] % 2 == 0)
      vec[0].push_back(p[i]);
    else
      vec[1].push_back(p[i]);
  }
  int v1 = 0, v2 = 0, p1 = 0, p2 = 0;
  for (int i = 1; i <= n; i++) {
    if (used[i]) continue;
    if (i % 2)
      v1 += abs(i - vec[0][p1++]);
    else
      v2 += abs(i - vec[1][p2++]);
  }
  printf("%d", min(v1, v2));
  return 0;
}
