#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 2e18;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  vector<int> a(n);
  for (int &x : a) cin >> x;
  int pres[2] = {0, 0};
  for (int i = 1; i <= n; ++i) {
    if (find((a).begin(), (a).end(), i) == a.end()) {
      pres[i & 1]++;
    }
  }
  vector<pair<int, int> > vec;
  int res = 0;
  for (int i = 0; i + 1 < n; ++i) {
    if (a[i] and a[i + 1] and a[i] % 2 != a[i + 1] % 2) ++res;
  }
  for (int i = 0; i < n; ++i) {
    if (a[i] == 0 or i + 1 == n or a[i + 1]) continue;
    int j = i + 1;
    for (; j < n and a[j] == 0; ++j)
      ;
    if (j < n) {
      if (a[i] % 2 == a[j] % 2) {
        vec.push_back(pair<int, int>(i, j));
      } else {
        res += 1;
      }
    }
    i = j - 1;
  }
  sort((vec).begin(), (vec).end(), [&](pair<int, int> &p, pair<int, int> &q) {
    return p.second - p.first < q.second - q.first;
  });
  for (auto qq : vec) {
    int w = a[qq.first] % 2;
    int l = qq.second - qq.first - 1;
    if (l > pres[w]) {
      res += 2;
    } else {
      pres[w] -= l;
    }
  }
  if (count((a).begin(), (a).end(), 0) == n) {
    cout << (n > 1 ? 1 : 0) << "\n";
    return 0;
  }
  if (a[0] == 0) {
    int idx = 1;
    while (a[idx] == 0) ++idx;
    int w = a[idx] % 2;
    if (pres[w] < idx)
      ++res;
    else
      pres[w] -= idx;
  }
  if (a[n - 1] == 0) {
    int idx = n - 2;
    while (a[idx] == 0) --idx;
    int w = a[idx] % 2;
    int l = n - 1 - idx;
    if (pres[w] < l)
      ++res;
    else
      pres[w] -= l;
  }
  cout << res << "\n";
  return 0;
}
