#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int mod = 1000000007;
int a[1000];
bool vis1[1000], vis2[1000];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n / 2; ++i) {
    cin >> a[i];
  }
  memset(vis1, false, sizeof(vis1)), memset(vis2, false, sizeof(vis2));
  for (int i = 1; i <= n / 2; ++i) {
    if (a[i] % 2 == 0)
      vis1[a[i]] = true;
    else if (a[i] % 2 != 0)
      vis2[a[i]] = true;
  }
  int cnt1 = 0, cnt2 = 0;
  for (int i = 1; i <= n / 2; ++i) {
    if (a[i] % 2 != 0) {
      for (int j = 1; j <= n; ++j) {
        if (j % 2 == 0 && !vis1[j]) {
          cnt1 += abs(a[i] - j);
          vis1[j] = true;
          break;
        }
      }
    }
  }
  for (int i = 1; i <= n / 2; ++i) {
    if (a[i] % 2 == 0) {
      for (int j = 1; j <= n; ++j) {
        if (j % 2 != 0 && !vis2[j]) {
          cnt2 += abs(a[i] - j);
          vis2[j] = true;
          break;
        }
      }
    }
  }
  cout << min(cnt1, cnt2) << endl;
  return 0;
}
