#include <bits/stdc++.h>
using namespace std;
vector<int> v;
const int MX = 105;
const int INF = 1010101010;
int n, x, a[MX], vis[MX], dp[MX][MX][MX], cnt[MX], b;
int sol(int cur, int pre, int one) {
  if (one < 0) return INF;
  if (cur == v.size()) {
    if (one == 0) {
      return 0;
    } else
      return INF;
  }
  int& ret = dp[cur][pre][one];
  if (ret != -1) return ret;
  ret = 0;
  int back = 0;
  int next = v[cur] + 1;
  if (a[v[cur] - 1] == -1 || v[cur] == 0) {
    back = pre;
  } else {
    back = a[v[cur] - 1];
  }
  if (v[cur] == 1) {
    if (next > n || a[next] == -1) {
      ret = sol(cur + 1, 1, one - 1);
      ret = min(ret, sol(cur + 1, 0, one));
    } else {
      ret = sol(cur + 1, 1, one - 1) + abs(1 - a[next]);
      ret = min(ret, sol(cur + 1, 0, one) + a[next]);
    }
  } else if (next > n || a[next] == -1) {
    ret = sol(cur + 1, 1, one - 1) + abs(back - 1);
    ret = min(ret, sol(cur + 1, 0, one) + back);
  } else {
    ret = sol(cur + 1, 1, one - 1) + abs(back - 1) + abs(1 - a[next]);
    ret = min(ret, sol(cur + 1, 0, one) + back + a[next]);
  }
  return ret;
}
int main() {
  memset(dp, -1, sizeof(dp));
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    if (x == 0) {
      v.push_back(i);
      a[i] = -1;
    } else {
      a[i] = x % 2;
      vis[x] = 1;
    }
  }
  for (int i = 2; i <= n; i++) {
    if (a[i] != -1 && a[i - 1] != -1) {
      b += abs(a[i] - a[i - 1]);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      cnt[i % 2]++;
    }
  }
  int ans = INF;
  if (v.size() == 0) {
    cout << b;
    return 0;
  } else {
    int cur = v[0];
    cout << min(sol(0, 0, cnt[1]), sol(0, 1, cnt[1])) + b << "\n";
  }
}
