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