//prewritten code: https://github.com/antma/algo
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.traits;

final class InputReader {
  private:
  ubyte[] p, buffer;
  bool eof;
  bool rawRead () {
    if (eof) {
      return false;
    }
    p = stdin.rawRead (buffer);
    if (p.empty) {
      eof = true;
      return false;
    }
    return true;
  }
  ubyte nextByte(bool check) () {
    static if (check) {
      if (p.empty) {
        if (!rawRead ()) {
          return 0;
        }
      }
    }
    auto r = p.front;
    p.popFront ();
    return r;
  }
  public:
  this () {
    buffer = uninitializedArray!(ubyte[])(16<<20);
  }
  bool seekByte (in ubyte lo) {
    while (true) {
      p = p.find! (c => c >= lo);
      if (!p.empty) {
        return false;
      }
      if (!rawRead ()) {
        return true;
      }
    }
  }
  template next(T) if (isSigned!T) {
    T next ()  {
      if (seekByte (45)) {
        return 0;
      }
      T res;
      ubyte b = nextByte!false ();
      if (b == 45) {
        while (true) {
          b = nextByte!true ();
          if (b < 48 || b >= 58) {
            return res;
          }
          res = res * 10 - (b - 48);
        }
      } else {
        res = b - 48;
        while (true) {
          b = nextByte!true ();
          if (b < 48 || b >= 58) {
            return res;
          }
          res = res * 10 + (b - 48);
        }
      }
    }
  }
  template next(T) if (isUnsigned!T) {
    T next () {
      if (seekByte (48)) {
        return 0;
      }
      T res = nextByte!false () - 48;
      while (true) {
        ubyte b = nextByte!true ();
        if (b < 48 || b >= 58) {
          break;
        }
        res = res * 10 + (b - 48);
      }
      return res;
    }
  }
  T[] nextA(T) (in int n) {
    auto a = uninitializedArray!(T[]) (n);
    foreach (i; 0 .. n) {
      a[i] = next!T;
    }
    return a;
  }
}

void main() {
  auto r = new InputReader ();
  immutable n = r.next!uint ();
  auto a = r.nextA!uint (n);
  auto b = new bool[n + 1];
  foreach (i; a) {
    b[i] = true;
  }
  int odds, evens;
  for (int i = 1; i <= n; ++i) {
    if (!b[i]) {
      if (i & 1) odds++; else evens++;
    }
  }
  int[] pos;
  foreach (i; 0 .. n) {
    if (a[i] == 0) pos ~= i;
  }
  immutable int m = pos.length.to!int;
  auto dp = new int[][][] (m + 1, odds + 1, 3);
  foreach (i; 0 .. m + 1) foreach (j; 0 .. odds + 1) dp[i][j][] = -1;
  auto vo = new int[m];
  auto ve = new int[m];
  b = new bool[m];
  foreach (i; 0 .. m) {
    immutable int k = pos[i];
    if (k > 0) {
      if (a[k-1] != 0) {
        if (a[k-1] & 1) {
          ve[i]++;
        } else {
          vo[i]++;
        }
      } else b[i] = true;
    }
    if (k+1 < n) {
      if (a[k+1] != 0) {
        if (a[k+1] & 1) {
          ve[i]++;
        } else {
          vo[i]++;
        }
      }
    }
  }
  debug stderr.writeln (vo);
  debug stderr.writeln (ve);
  debug stderr.writeln (b);
  debug stderr.writeln (odds);
  debug stderr.writeln (evens);

  int f (const int k, const int o, const int last) {
    if (dp[k][o][last] >= 0) return dp[k][o][last];
    immutable int r = m - k;
    if (!r) return dp[k][o][last] = 0; 
    immutable int co = odds - o,
       ce = k - co,
       e = evens - ce;
    assert (e >= 0);
    int res = int.max;
    if (o > 0) {
      int w = f (k + 1, o - 1, 1) + vo[k];
      if (b[k] && last == 0) ++w;
      res = min (res, w);
    }
    if (e > 0) {
      int w = f (k + 1, o, 0) + ve[k];
      if (b[k] && last == 1) ++w;
      res = min (res, w);
    }
    return dp[k][o][last] = res;
  }
  int res = f (0, odds, 2);
  foreach (i; 1 .. n) {
    if (a[i-1] != 0 && a[i] != 0 && 0 != ((a[i-1] ^ a[i]) & 1)) {
      ++res;
    }
  }
  writeln (res);
}

