#include <bits/stdc++.h>
using namespace std;
long long int cal = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  long long int n;
  cin >> n;
  long long int a[101];
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0 and a[i - 1] == a[i + 1] and a[i - 1] == 1 and
        a[i + 1] == 1) {
      cal++;
      a[i - 1] = 0;
      a[i + 1] = 0;
    }
  }
  cout << cal;
  return 0;
}
