#include <bits/stdc++.h>
using namespace std;
bool t[100];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> t[i];
  int m = 0;
  int i = 1;
  while (i < n - 1) {
    if (t[i - 1] == t[i + 1] && t[i + 1] == 1 && t[i] == 0) {
      m++;
      i += 3;
    } else
      i++;
  }
  cout << m << endl;
  return 0;
}
