#include <bits/stdc++.h>
using namespace std;
const int N = 102;
int p[N], vis[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n / 2; i++) {
    scanf("%d", &p[i]);
    vis[p[i]] = 1;
  }
  int mn = 10000;
  for (int i = 0; i < 2; i++) {
    int cnt = 0;
    for (int j = 1; j <= n; j++) {
      if (vis[j] > 0) {
        if ((j & 1) == i) {
          vis[j + 1] += vis[j] - 1;
          cnt += vis[j] - 1;
        } else {
          vis[j + 1] += vis[j];
          cnt += vis[j];
        }
      } else {
        if ((j & 1) == i) {
          if (vis[j] > vis[j - 1]) {
            vis[j + 1] += vis[j];
            cnt -= vis[j];
          } else {
            vis[j + 1] += vis[j] - 1;
            cnt -= vis[j] - 1;
          }
        } else {
          vis[j + 1] += vis[j];
          cnt -= vis[j];
        }
      }
    }
    mn = min(mn, cnt);
    memset(vis, 0, sizeof(vis));
    for (int j = 0; j < n / 2; j++) {
      vis[p[j]] = 1;
    }
  }
  printf("%d", mn);
  return 0;
}
