#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6) {
    if (n % i == 0 || n % (i + 2) == 0) return false;
  }
  return true;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  if (a < b) swap(a, b);
  return gcd(a % b, b);
}
long long gcdextended(long long a, long long b, long long &x, long long &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long x1, y1, gcd = gcdextended(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return gcd;
}
long long modinverse(long long a, long long m) {
  long long x, y;
  long long g = gcdextended(a, m, x, y);
  if (g != 1) {
    cout << "NOT POSSIBLE";
    return -1;
  } else
    return (x % m + m) % m;
}
long long po(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long pom(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long root(long long x, vector<long long> &id) {
  while (id[x] != x) {
    id[x] = id[id[x]];
    x = id[x];
  }
  return x;
}
void uni(long long x, long long y, vector<long long> &id) {
  long long a = root(x, id);
  long long b = root(y, id);
  id[a] = id[b];
}
bool sec(const pair<long long, long long> &a,
         const pair<long long, long long> &b) {
  return a.second < b.second;
}
void solve() {
  long long n, i, j, k;
  cin >> n;
  long long a[n], x = 0, y = 0;
  vector<pair<long long, long long> > b, o, e;
  vector<long long> c(n, -1);
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 0) continue;
    c[i] = a[i] % 2;
    b.push_back(make_pair(a[i] % 2, i));
    if (a[i] & 1)
      x++;
    else
      y++;
  }
  if (b.size() == 0) {
    if (n == 1)
      cout << 0;
    else
      cout << 1;
    return;
  }
  x = (n + 1) / 2 - x, y = n / 2 - y;
  for (i = 1; i < b.size(); i++) {
    if (b[i].first == b[i - 1].first) {
      if (b[i].first)
        o.push_back(
            make_pair(b[i].second - b[i - 1].second - 1, b[i - 1].second + 1));
      else
        e.push_back(
            make_pair(b[i].second - b[i - 1].second - 1, b[i - 1].second + 1));
    }
  }
  sort(o.begin(), o.end());
  sort(e.begin(), e.end());
  i = 0;
  while (i < o.size() && o[i].first <= x) {
    for (k = 0; k < o[i].first; k++) c[o[i].second + k] = 1;
    x -= o[i].first, i++;
  }
  j = 0;
  while (j < e.size() && e[j].first <= y) {
    for (k = 0; k < e[j].first; k++) c[e[j].second + k] = 0;
    y -= e[j].first, j++;
  }
  if (b[0].second > n - 1 - b.back().second) {
    for (k = b.back().second + 1; k < n; k++) {
      if (b.back().first == 0) {
        if (y > 0)
          c[k] = 0, y--;
        else
          c[k] = 1, x--;
      } else {
        if (x > 0)
          c[k] = 1, x--;
        else
          c[k] = 0, y--;
      }
    }
    for (k = b[0].second - 1; k > -1; k--) {
      if (b[0].first == 0) {
        if (y > 0)
          c[k] = 0, y--;
        else
          c[k] = 1, x--;
      } else {
        if (x > 0)
          c[k] = 1, x--;
        else
          c[k] = 0, y--;
      }
    }
  } else {
    for (k = b[0].second - 1; k > -1; k--) {
      if (b[0].first == 0) {
        if (y > 0)
          c[k] = 0, y--;
        else
          c[k] = 1, x--;
      } else {
        if (x > 0)
          c[k] = 1, x--;
        else
          c[k] = 0, y--;
      }
    }
    for (k = b.back().second + 1; k < n; k++) {
      if (b.back().first == 0) {
        if (y > 0)
          c[k] = 0, y--;
        else
          c[k] = 1, x--;
      } else {
        if (x > 0)
          c[k] = 1, x--;
        else
          c[k] = 0, y--;
      }
    }
  }
  for (i = 1; i < n; i++) {
    if (c[i] != -1) continue;
    if (c[i - 1] == 0) {
      if (y > 0)
        c[i] = 0, y--;
      else
        c[i] = 1, x--;
    } else {
      if (x > 0)
        c[i] = 1, x--;
      else
        c[i] = 0, y--;
    }
  }
  long long an = 0;
  for (i = 1; i < n; i++)
    if (c[i] != c[i - 1]) an++;
  cout << an;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  ;
  long long t, an = 0;
  t = 1;
  while (t--) {
    solve();
  }
}
