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