#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long long inf = 2e18 + 5;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int rem[n + 1];
  memset(rem, 0, sizeof(rem));
  vector<int> a(n);
  for (int i = (0); i < (n); i++) {
    cin >> a[i];
    if (a[i] != 0) rem[a[i]] = 1;
  }
  int odd = 0, even = 0;
  for (int i = (1); i < (n + 1); i++) {
    if (rem[i] == 0) {
      if (i % 2 == 0)
        even++;
      else
        odd++;
    }
  }
  if (odd + even == n) {
    if (odd == 0 || even == 0)
      cout << 0;
    else
      cout << 1;
    return 0;
  }
  vector<int> e, o, eo, eedge, oedge;
  int j, c;
  for (int i = (0); i < (n); i++) {
    if (a[i] == 0) {
      j = i + 1;
      c = 1;
      while (j < n) {
        if (a[j] != 0) break;
        j++;
        c++;
      }
      if (i == 0) {
        if (a[j] % 2)
          oedge.push_back(c);
        else
          eedge.push_back(c);
      } else if (j == n) {
        if (a[i - 1] % 2)
          oedge.push_back(c);
        else
          eedge.push_back(c);
      } else {
        if (a[i - 1] % 2 == a[j] % 2 && a[i - 1] % 2 == 1)
          o.push_back(c);
        else if (a[i - 1] % 2 == a[j] % 2 && a[i - 1] % 2 == 0)
          e.push_back(c);
        else
          eo.push_back(c);
      }
      i = j - 1;
    }
  }
  sort(o.begin(), o.end());
  sort(e.begin(), e.end());
  sort(oedge.begin(), oedge.end());
  sort(eedge.begin(), eedge.end());
  int x = o.size();
  for (int i = 0; i < o.size(); i++) {
    if (odd >= o[i])
      odd -= o[i];
    else {
      x = i;
      break;
    }
  }
  long long ans = 2 * (o.size() - x);
  x = e.size();
  for (int i = 0; i < e.size(); i++) {
    if (even >= e[i])
      even -= e[i];
    else {
      x = i;
      break;
    }
  }
  ans += 2 * (e.size() - x);
  ans += (int)(eo.size());
  for (auto x : eedge) {
    if (x <= even) {
      even -= x;
    } else {
      ans++;
    }
  }
  for (auto x : oedge) {
    if (x <= odd) {
      odd -= x;
    } else {
      ans++;
    }
  }
  for (int i = (1); i < (n); i++) {
    if (a[i] != 0 && a[i - 1] != 0 && a[i] % 2 != a[i - 1] % 2) ans++;
  }
  cout << ans;
}
