#include <bits/stdc++.h>
using namespace std;
long long GCD(long long x, long long y) {
  if (y == 0) return x;
  return GCD(y, x % y);
}
long long LCM(long long x, long long y) { return (x * y) / GCD(x, y); }
long long MPOW(long long a, long long b, long long m) {
  if (b == 0) return 1;
  long long x = MPOW(a, b / 2, m);
  x = (x * x) % m;
  if (b % 2 == 1) x = (x * a) % m;
  return x;
}
long long MINV(long long a, long long m) { return MPOW(a, m - 2, m); }
long long MFACT(long long n, long long m) {
  if (m <= n)
    return 0;
  else if (n == 0)
    return 1;
  else
    return ((MFACT(n - 1, m) * n) % m);
}
inline long long max(long long a, long long b) { return (a > b) ? a : b; }
inline long long min(long long a, long long b) { return (a < b) ? a : b; }
inline void swap(long long &a, long long &b) {
  long long temp = a;
  a = b;
  b = temp;
  return;
}
inline long long max3(long long a, long long b, long long c) {
  return max(a, max(b, c));
}
inline long long min3(long long a, long long b, long long c) {
  return min(a, min(b, c));
}
inline bool sortbythis(pair<long long, long long> a,
                       pair<long long, long long> b) {
  return (((a.first == b.first) && (a.second < b.second)) ||
          (a.first < b.first));
}
inline bool sortbythat(pair<long long, long long> a,
                       pair<long long, long long> b) {
  return (((a.second == b.second) && (a.first < b.first)) ||
          (a.second < b.second));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, o, e;
  cin >> n;
  e = n / 2;
  o = n - e;
  vector<long long> v(n);
  for (long long i = 0; i < n; ++i) {
    cin >> v[i];
    if (v[i] == 0)
      continue;
    else if (v[i] % 2 == 0)
      e--;
    else
      o--;
  }
  if (n == 1) {
    cout << 0 << '\n';
    return 0;
  }
  long long ans = 0;
  vector<long long> a, b, c, a1, b1;
  long long pos = 0, pos1 = 0;
  while (pos < n) {
    if (v[pos] != 0) {
      pos++;
      if (pos == n) break;
      if (v[pos] != 0 && v[pos] % 2 != v[pos - 1] % 2) ans++;
    } else {
      pos1 = pos + 1;
      while (pos1 < n && v[pos1] == 0) pos1++;
      if (pos == 0) {
        if (pos1 == n)
          c.push_back(pos1 - pos);
        else if (v[pos1] % 2 == 0)
          a1.push_back(pos1 - pos);
        else
          b1.push_back(pos1 - pos);
      } else if (pos1 == n) {
        if (v[pos - 1] % 2 == 0)
          a1.push_back(pos1 - pos);
        else
          b1.push_back(pos1 - pos);
      } else {
        if (v[pos - 1] % 2 == 0 && v[pos1] % 2 == 0)
          a.push_back(pos1 - pos);
        else if (v[pos - 1] % 2 == 1 && v[pos1] % 2 == 1)
          b.push_back(pos1 - pos);
        else
          c.push_back(pos1 - pos);
      }
      pos = pos1;
    }
  }
  sort(a.begin(), a.end(), greater<long long>());
  sort(b.begin(), b.end(), greater<long long>());
  sort(a1.begin(), a1.end(), greater<long long>());
  sort(b1.begin(), b1.end(), greater<long long>());
  while (a.size() > 0 && e - a.back() >= 0) {
    e -= a.back();
    a.pop_back();
  }
  while (a1.size() > 0 && e - a1.back() >= 0) {
    e -= a1.back();
    a1.pop_back();
  }
  while (b.size() > 0 && o - b.back() >= 0) {
    o -= b.back();
    b.pop_back();
  }
  while (b1.size() > 0 && o - b1.back() >= 0) {
    o -= b1.back();
    b1.pop_back();
  }
  ans += c.size() + a1.size() + b1.size() + 2 * (a.size() + b.size());
  cout << ans << '\n';
  return 0;
}
