#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 2;
int n, counter;
int flats[maxn];
inline void init() { counter = 0; }
int main() {
  ios::sync_with_stdio(false);
  init();
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> flats[i];
  for (int i = 2; i <= n - 1; ++i) {
    if (flats[i] == 0)
      if (flats[i - 1] * flats[i + 1] == 1) {
        flats[i + 1] = 0;
        ++counter;
      }
  }
  cout << counter << endl;
  return 0;
}
