#include <bits/stdc++.h>
using namespace std;
int n;
int a[101];
int res = 0;
void solve() {
  for (int i = 2; i < n; ++i) {
    if (a[i] == 0) {
      if (a[i - 1] == 1 && a[i + 1] == 1 && a[i + 2] == 0 && a[i + 3] == 1 &&
          i - 1 > 0) {
        a[i + 1] = 0;
        ++res;
        i += 2;
      } else if (a[i + 1] == 1 && a[i - 1] == 1 && i - 1 > 0) {
        a[i + 1] = 0;
        ++res;
        ++i;
      }
    }
  }
  cout << res << endl;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
  }
  solve();
  return 0;
}
