#include <bits/stdc++.h>
using namespace std;
struct comp {
  bool operator()(pair<int, int> a, pair<int, int> b) {
    return (a.second - a.first) < (b.second - b.first);
  }
};
int main() {
  int n, data[105] = {}, oddCount = 0, evenCount = 0, fromFront = -1,
         fromEnd = -1;
  bool exist[105] = {};
  vector<pair<int, int> > oddQ, evenQ;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &data[i]);
    exist[data[i]] = true;
  }
  for (int i = 1; i <= n; i++)
    if (!exist[i]) {
      if (i % 2 == 1)
        oddCount++;
      else
        evenCount++;
    }
  int l = -1, r = -1;
  for (int i = 1; i <= n; i++) {
    if (data[i] == 0) {
      if (l == -1) l = i;
      r = i;
    }
    if ((data[i] != 0 || i == n) && l != -1) {
      if (l == 1)
        fromFront = r - l + 1;
      else if (r == n)
        fromEnd = r - l + 1;
      else if (data[l - 1] % 2 == data[r + 1] % 2) {
        if (data[l - 1] % 2 == 1)
          oddQ.push_back(make_pair(l, r));
        else
          evenQ.push_back(make_pair(l, r));
      }
      l = r = -1;
    }
  }
  sort(oddQ.begin(), oddQ.end(), comp());
  sort(evenQ.begin(), evenQ.end(), comp());
  int size = (int)oddQ.size();
  for (int i = 0; i <= size - 1; i++) {
    if (oddQ[i].second - oddQ[i].first + 1 <= oddCount) {
      for (int j = oddQ[i].first; j <= oddQ[i].second; j++) data[j] = 1;
      oddCount -= oddQ[i].second - oddQ[i].first + 1;
    }
  }
  size = (int)evenQ.size();
  for (int i = 0; i <= size - 1; i++) {
    if (evenQ[i].second - evenQ[i].first + 1 <= evenCount) {
      for (int j = evenQ[i].first; j <= evenQ[i].second; j++) data[j] = 2;
      evenCount -= evenQ[i].second - evenQ[i].first + 1;
    }
  }
  if (fromFront != -1) {
    if (data[fromFront + 1] % 2 == 1 && oddCount >= fromFront) {
      for (int i = 1; i <= fromFront; i++) data[i] = 1;
      oddCount -= fromFront;
    } else if (data[fromFront + 1] % 2 == 0 && evenCount >= fromFront) {
      for (int i = 1; i <= fromFront; i++) data[i] = 2;
      evenCount -= fromFront;
    }
  }
  if (fromEnd != -1) {
    if (data[n - fromEnd] % 2 == 1 && oddCount >= fromEnd) {
      for (int i = 1; i <= fromEnd; i++) data[n - i + 1] = 1;
      oddCount -= fromEnd;
    } else if (data[n - fromEnd] % 2 == 0 && evenCount >= fromEnd) {
      for (int i = 1; i <= fromEnd; i++) data[n - i + 1] = 2;
      evenCount -= fromEnd;
    }
  }
  int anchorIdx = 0;
  for (int i = 1; i <= n; i++)
    if (data[i] != 0) {
      anchorIdx = i;
      break;
    }
  for (int i = anchorIdx - 1; i >= 1; i--)
    if (data[i] == 0) {
      if ((data[i + 1] % 2 == 1 && oddCount > 0) || evenCount == 0) {
        data[i] = 1;
        oddCount--;
      } else {
        data[i] = 2;
        evenCount--;
      }
    }
  for (int i = anchorIdx + 1; i <= n; i++)
    if (data[i] == 0) {
      if ((data[i - 1] % 2 == 1 && oddCount > 0) || evenCount == 0) {
        data[i] = 1;
        oddCount--;
      } else {
        data[i] = 2;
        evenCount--;
      }
    }
  int ans = 0;
  for (int i = 2; i <= n; i++)
    if (data[i] % 2 != data[i - 1] % 2) ans++;
  printf("%d\n", ans);
  return 0;
}
