#include <bits/stdc++.h>
using namespace std;
inline long long add(long long a, long long b) {
  a += b;
  if (a >= 1000000007) a -= 1000000007;
  return a;
}
inline long long sub(long long a, long long b) {
  a -= b;
  if (a < 0) a += 1000000007;
  return a;
}
inline long long mul(long long a, long long b) {
  return (a * 1ll * b) % 1000000007;
}
inline long long power(long long a, long long b) {
  long long rt = 1;
  while (b > 0) {
    if (b & 1) rt = mul(rt, a);
    a = mul(a, a);
    b >>= 1;
  }
  return rt;
}
inline long long inv(long long a) { return power(a, 1000000007 - 2); }
vector<long long> se;
bool prime[1000005];
void SieveOfEratosthenes() {
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= 1000005; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= 1000005; i += p) prime[i] = false;
    }
  }
  for (long long p = 2; p <= 1000005; p++)
    if (prime[p]) se.push_back(p);
}
long long power(long long x, unsigned long long y, long long p) {
  long long res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long ar[n + 1];
  vector<long long> v, e, od;
  long long cnt = 0, co = 0, ce = 0, remod = 0, reme = 0;
  for (long long i = 0; i < (long long)n; ++i) {
    cin >> ar[i];
    if (ar[i] % 2)
      co++;
    else if (ar[i])
      ce++;
    if (ar[i]) v.push_back(i);
  }
  if (n & 1)
    remod = (n / 2 + 1) - co;
  else
    remod = n / 2 - co;
  reme = n / 2 - ce;
  for (long long i = 0; i < (long long)(long long)v.size() - 1; ++i) {
    if (ar[v[i]] % 2 != ar[v[i + 1]] % 2)
      cnt++;
    else if (ar[v[i]] % 2 == ar[v[i + 1]] % 2 && ar[v[i + 1]] % 2)
      od.push_back(v[i + 1] - v[i] - 1);
    else if (ar[v[i]] % 2 == ar[v[i + 1]] % 2 && ar[v[i + 1]] % 2 == 0)
      e.push_back(v[i + 1] - v[i] - 1);
  }
  if ((long long)v.size() == 0) {
    if (n == 1)
      cout << 0 << endl;
    else
      cout << 1 << endl;
    return 0;
  }
  sort(od.begin(), od.end());
  sort(e.begin(), e.end());
  for (auto i : od) {
    if (i > remod)
      cnt += 2;
    else
      remod -= i;
  }
  for (auto i : e) {
    if (i > reme)
      cnt += 2;
    else
      reme -= i;
  }
  if ((long long)v.size() && v[0] != 0) {
    cnt++;
    if (ar[v[0]] % 2) {
      if (remod >= v[0]) {
        cnt--;
        remod -= v[0];
      }
    } else if (reme >= v[0]) {
      cnt--;
      reme -= v[0];
    }
  }
  if ((long long)v.size() && v[(long long)v.size() - 1] < n - 1) {
    cnt++;
    long long k = v[(long long)v.size() - 1];
    if (ar[k] % 2) {
      if (remod >= n - k - 1) cnt--;
    } else if (reme >= n - k - 1)
      cnt--;
  }
  cout << cnt << endl;
}
