#include <bits/stdc++.h>
using namespace std;
vector<long long> a;
long long solve(long long i, long long last, long long odd, long long even,
                long long n, vector<vector<vector<vector<long long> > > > &dp) {
  if (i == n) return 0;
  if (dp[i][odd][even][last] != -1) return dp[i][odd][even][last];
  long long ans = 100000000000000000LL;
  if (a[i] != -1) {
    if (i == 0)
      ans = solve(i + 1, a[i], odd, even, n, dp);
    else
      ans = solve(i + 1, a[i], odd, even, n, dp) + abs(last - a[i]);
    dp[i][odd][even][last] = ans;
    return ans;
  } else {
    if (i == 0) {
      long long ans1 = 1000000000000000000LL;
      long long ans2 = ans1;
      if (odd > 0) ans1 = solve(i + 1, 1, odd - 1, even, n, dp);
      if (even > 0) ans2 = solve(i + 1, 0, odd, even - 1, n, dp);
      ans = min(ans1, ans2);
    } else {
      long long ans1 = 1000000000000000000LL;
      long long ans2 = ans1;
      if (odd > 0)
        ans1 = (solve(i + 1, 1, odd - 1, even, n, dp) + abs(last - 1));
      if (even > 0)
        ans2 = (solve(i + 1, 0, odd, even - 1, n, dp) + abs(last - 0));
      ans = min(ans1, ans2);
    }
  }
  dp[i][odd][even][last] = ans;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long lef = 0, odd = 0, eve = 0;
  long long n;
  cin >> n;
  lef = n;
  odd = ceil(n / (double)2);
  eve = n / 2;
  for (long long i = 0; i < n; i++) {
    long long k;
    cin >> k;
    if (k == 0)
      a.push_back(-1);
    else
      a.push_back(k % 2);
    if (k != 0) {
      lef--;
      if (k % 2 == 1)
        odd--;
      else
        eve--;
    }
  }
  vector<long long> dp1(2, -1);
  vector<vector<long long> > dp2(105, dp1);
  vector<vector<vector<long long> > > dp3(105, dp2);
  vector<vector<vector<vector<long long> > > > dp(105, dp3);
  long long ans = solve(0, 0, odd, eve, n, dp);
  cout << ans << endl;
  return 0;
}
