#include <bits/stdc++.h>
using namespace std;
int n;
int a[105], b[105], c[105];
int p[105];
int main() {
  int l = 0, r = 0, ans = 0;
  scanf("%d", &n);
  if (n == 1) {
    printf("0\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (i != 1) {
      if (a[i] != 0 && a[i - 1] != 0) {
        if ((a[i] & 1) != (a[i - 1] & 1)) {
          ans++;
        }
      }
    }
    p[a[i]] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (p[i] != 1) {
      if (i & 1) {
        r++;
      } else {
        l++;
      }
    }
  }
  int now1 = 0, now2 = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      int m = i;
      if (i == 1) {
        while (a[i + 1] == 0 && i + 1 <= n) {
          i++;
        }
      } else {
        int flag = (a[i - 1] & 1);
        while (a[i + 1] == 0 && i + 1 <= n) {
          i++;
        }
        if (i == n) {
          break;
        } else {
          if ((a[i + 1] & 1) != flag) {
            ans++;
          } else {
            if (flag & 1) {
              b[now1++] = i - m + 1;
            } else {
              c[now2++] = i - m + 1;
            }
          }
        }
      }
    }
  }
  sort(b, b + now1);
  sort(c, c + now2);
  int x = 0, y = 0;
  while (r >= b[x] && x < now1) {
    r -= b[x];
    x++;
  }
  while (l >= c[y] && y < now2) {
    l -= c[y];
    y++;
  }
  if (a[1] == 0) {
    int m = 1;
    while (a[m + 1] == 0 && m + 1 <= n) {
      m++;
    }
    if (m == n) {
      ans++;
    } else {
      if (a[m + 1] & 1) {
        if (r < m) {
          ans++;
        } else {
          r -= m;
        }
      } else {
        if (l < m) {
          ans++;
        } else {
          l -= m;
        }
      }
    }
  }
  if (a[n] == 0) {
    int m = n;
    while (a[m - 1] == 0 && m - 1 >= 1) {
      m--;
    }
    if (m != 1) {
      if (a[m - 1] & 1) {
        if (r < n - m + 1) {
          ans++;
        }
      } else {
        if (l < n - m + 1) {
          ans++;
        }
      }
    }
  }
  ans += (now1 - x) * 2 + (now2 - y) * 2;
  printf("%d\n", ans);
  return 0;
}
