#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e7 + 11, M = 1e2 + 9;
const long long int LIMIT = 1 << 31;
unordered_map<string, long long int> cnt;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int ar[n];
  vector<long long int> vis(n + 1, false);
  for (long long int i = 0; i < n; ++i) {
    cin >> ar[i];
    vis[ar[i]] = true;
  }
  long long int odd = 0, even = 0;
  for (long long int i = 1; i <= n; ++i) {
    if (!vis[i]) {
      if (i & 1)
        odd++;
      else
        even++;
    }
  }
  long long int cnt = 0;
  long long int i = 0;
  while (ar[i] == 0) {
    cnt++;
    ++i;
  }
  if (i == n) {
    cout << (n == 1 ? 0 : 1) << endl;
    return 0;
  }
  long long int prev = 0, opp = 0;
  vector<long long int> oddv, evenv;
  long long int samne_even = 0, samne_odd = 0, piche_even = 0, piche_odd = 0;
  if (ar[i] & 1) {
    samne_odd = cnt;
    cnt = 0;
    prev = 1;
  } else {
    samne_even = cnt;
    cnt = 0;
    prev = 2;
  }
  while (i < n) {
    if (ar[i] == 0) {
      cnt++;
      ++i;
      continue;
    }
    if (ar[i] & 1) {
      if (prev == 2) {
        ++opp;
      } else if (cnt) {
        oddv.push_back(cnt);
      }
      prev = 1;
      cnt = 0;
    } else {
      if (prev == 1) {
        ++opp;
      } else if (cnt) {
        evenv.push_back(cnt);
      }
      prev = 2;
      cnt = 0;
    }
    ++i;
  }
  if (cnt) {
    if (prev == 1) {
      piche_odd = cnt;
    } else {
      piche_even = cnt;
    }
  }
  sort(oddv.begin(), oddv.end());
  sort(evenv.begin(), evenv.end());
  long long int oi = 0, ei = 0;
  while (oi < oddv.size()) {
    if (odd - oddv[oi] >= 0) {
      odd -= oddv[oi];
    } else {
      break;
    }
    ++oi;
  }
  while (ei < evenv.size()) {
    if (even - evenv[ei] >= 0) {
      even -= evenv[ei];
    } else {
      break;
    }
    ++ei;
  }
  long long int baaki_odd = oddv.size() - oi;
  long long int baaki_even = evenv.size() - ei;
  if (baaki_even) {
    opp += (2 * baaki_even);
  }
  if (baaki_odd) {
    opp += (2 * baaki_odd);
  }
  if (samne_odd > piche_odd) swap(samne_odd, piche_odd);
  if (samne_even > piche_even) swap(samne_even, piche_even);
  if (samne_even + piche_even > even) {
    opp++;
    if (samne_even > 0 && samne_even > even) opp++;
  }
  if (samne_odd + piche_odd > odd) {
    opp++;
    if (samne_odd > 0 && samne_odd > odd) opp++;
  }
  cout << opp << endl;
  return 0;
}
