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