#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  int ch = 0, ne = 0;
  vector<int> chet, nech;
  bool last = false, start = true;
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  int col = 0;
  int pause = 0;
  int st_ch_dop = 0, st_ne_dop = 0, en_ch_dop = 0, en_ne_dop = 0;
  for (int i = 0; i < n; ++i) {
    if (v[i] == 0) {
      ++pause;
      continue;
    }
    if (start == true) {
      if (v[i] % 2 == 0) {
        last = true;
        st_ch_dop = pause;
      } else {
        last = false;
        st_ne_dop = pause;
      }
      start = false;
      pause = 0;
    }
    if (v[i] % 2 == 0) {
      ++ch;
      if (last == true) {
        if (pause != 0) {
          chet.push_back(pause);
        }
      } else {
        ++col;
      }
      pause = 0;
      last = true;
    } else {
      ++ne;
      if (last == false) {
        if (pause != 0) {
          nech.push_back(pause);
        }
      } else {
        ++col;
      }
      pause = 0;
      last = false;
    }
  }
  if (v.back() == 0) {
    if (last == true) {
      en_ch_dop = pause;
    } else {
      en_ne_dop = pause;
    }
  }
  ch = int(n / 2) - ch;
  ne = int(n / 2) + n % 2 - ne;
  sort(chet.begin(), chet.end());
  sort(nech.begin(), nech.end());
  int close_ch = 0, close_ne = 0;
  for (auto el : chet) {
    if (el <= ch) {
      ch -= el;
      ++close_ch;
    } else {
      break;
    }
  }
  col += (chet.size() - close_ch) * 2;
  for (auto el : nech) {
    if (el <= ne) {
      ne -= el;
      ++close_ne;
    } else {
      break;
    }
  }
  col += (nech.size() - close_ne) * 2;
  if (min(st_ch_dop, en_ch_dop) <= ch) {
    ch -= min(st_ch_dop, en_ch_dop);
  } else {
    ++col;
  }
  if (max(st_ch_dop, en_ch_dop) <= ch) {
    ch -= max(st_ch_dop, en_ch_dop);
  } else {
    ++col;
  }
  if (min(st_ne_dop, en_ne_dop) <= ne) {
    ne -= min(st_ne_dop, en_ne_dop);
  } else {
    ++col;
  }
  if (max(st_ne_dop, en_ne_dop) <= ne) {
    ne -= max(st_ne_dop, en_ne_dop);
  } else {
    ++col;
  }
  cout << col << endl;
  return 0;
}
