#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a[100], k = 0;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 1; i < n - 1; i++) {
    if (a[i] == 0 && a[i - 1] == 1 && a[i + 1] == 1) {
      k++;
      a[i + 1]--;
    }
  }
  cout << k;
}
