#include <bits/stdc++.h>
using namespace std;
const int MA = 105;
int n, ans = 0;
int a[MA];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  for (int i = 2; i < n; ++i) {
    if (!a[i] && a[i - 1] && a[i + 1]) {
      a[i + 1] = 0;
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
