#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& out, vector<T> v) {
  for (T t : v) out << t << ' ';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, set<T> v) {
  for (T t : v) out << t << ' ';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, pair<T, T> v) {
  out << v.first << ' ' << v.second;
  return out;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, cnt[2] = {0, 0}, r = 0;
  cin >> n;
  vector<int> a(n + 2);
  vector<pair<int, int> > v;
  int pre = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    if (a[i] == 0) {
      if (i == n) v.push_back({pre, n + 1});
    } else {
      if (a[i - 1] != 0 && (a[i - 1] - a[i]) & 1) r++;
      if (a[i - 1] == 0 && i > 1) v.push_back({pre, i});
      pre = i;
      cnt[a[i] & 1]++;
    }
  }
  sort(v.begin(), v.end(), [&](pair<int, int> u, pair<int, int> w) {
    int hu = u.second - u.first, hv = w.second - w.first;
    if (u.first == 0 || u.second == n + 1) return false;
    if (w.first == 0 || w.second == n + 1) return true;
    return hu < hv;
  });
  cnt[1] = (n + 1) / 2 - cnt[1];
  cnt[0] = n / 2 - cnt[0];
  for (auto t : v) {
    if (t.first == 0 && t.second == n + 1) {
      r += (n != 1);
      continue;
    }
    int l = t.second - t.first - 1;
    if (t.first == 0 || t.second == n + 1) {
      int num = a[t.first] + a[t.second];
      int si = num & 1;
      if (l <= cnt[si])
        cnt[si] -= l;
      else {
        r++;
      }
    } else {
      if ((a[t.first] - a[t.second]) & 1) {
        r++;
      } else {
        int si = a[t.first] & 1;
        if (l <= cnt[si])
          cnt[si] -= l;
        else
          r += 2;
      }
    }
  }
  cout << r;
  return 0;
}
