#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  int a[105];
  while (scanf("%d", &n) != EOF) {
    int ans = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d", &a[i]);
      if (i >= 2 && a[i] == 1 && a[i - 2] == 1 && a[i - 1] == 0) {
        ans++;
        a[i] = 0;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
