#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
template <class C>
void mini(C& a, C b) {
  a = min(a, b);
}
template <class C>
void maxi(C& a, C b) {
  a = max(a, b);
}
void a() {
  int n;
  cin >> n;
  vector<int> p(n);
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  if (n == 1) {
    cout << "0\n";
    return;
  }
  int pares = n / 2;
  int impares = (n + 1) / 2;
  for (int i = 0; i < n; i++) {
    if (p[i] == 0) continue;
    if (p[i] % 2 == 1)
      impares--;
    else
      pares--;
  }
  if (pares + impares == n) {
    cout << "1\n";
    return;
  }
  vector<int> imp1, par1, imp2, par2;
  int complejidad = 0;
  int l = 0;
  int r;
  while (l < n) {
    while (l < n and p[l] != 0) l++;
    r = l;
    while (r < n and p[r] == 0) r++;
    if (l == 0) {
      if (p[r] % 2 == 1)
        imp1.push_back(r - l);
      else
        par1.push_back(r - l);
    } else if (r == n) {
      if (p[l - 1] % 2 == 1)
        imp1.push_back(r - l);
      else
        par1.push_back(r - l);
    } else if (p[l - 1] % 2 == 0 and p[r] % 2 == 0)
      par2.push_back(r - l);
    else if (p[l - 1] % 2 == 1 and p[r] % 2 == 1)
      imp2.push_back(r - l);
    else
      complejidad++;
    l = r;
  }
  sort(par1.begin(), par1.end());
  reverse(par1.begin(), par1.end());
  sort(par2.begin(), par2.end());
  reverse(par2.begin(), par2.end());
  sort(imp1.begin(), imp1.end());
  reverse(imp1.begin(), imp1.end());
  sort(imp2.begin(), imp2.end());
  reverse(imp2.begin(), imp2.end());
  while (!par2.empty() and pares >= par2.back()) {
    pares -= par2.back();
    par2.pop_back();
  }
  while (!par1.empty() and pares >= par1.back()) {
    pares -= par1.back();
    par1.pop_back();
  }
  while (!imp2.empty() and impares >= imp2.back()) {
    impares -= imp2.back();
    imp2.pop_back();
  }
  while (!imp1.empty() and impares >= imp1.back()) {
    impares -= imp1.back();
    imp1.pop_back();
  }
  for (int i = 0; i < n - 1; i++)
    if (p[i] != 0 and p[i + 1] != 0 and (p[i] + p[i + 1]) % 2 != 0)
      complejidad++;
  complejidad += imp1.size();
  complejidad += 2 * imp2.size();
  complejidad += par1.size();
  complejidad += 2 * par2.size();
  cout << complejidad << '\n';
}
int main() {
  a();
  return 0;
}
