#include <bits/stdc++.h>
using namespace std;
const long long OO = 1e8;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
bool x[103];
int n;
int co() {
  int count = 0;
  for (int i = 1; i < n - 1; i++) {
    if (x[i] == 0) {
      if (x[i - 1] == 1 && x[i + 1] == 1) {
        count++;
      }
    }
  }
  return count;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  cin >> n;
  for (int i = 0; i < (int)(n); ++i) {
    cin >> x[i];
  }
  int num = co();
  if (num == 0) {
    cout << num;
    return 0;
  }
  int j = 1;
  bool y = true;
  int coun = 0;
  while (co() != 0) {
    coun++;
    for (int i = j; (i < (n - 1)) && y; i++) {
      if (x[i] == 0) {
        if (x[i - 1] == 1 && x[i + 1] == 1) {
          x[i + 1] = 0;
          y = false;
        }
      }
      j = i;
    }
    y = true;
  }
  cout << coun;
  return 0;
}
