#include <bits/stdc++.h>
using namespace std;
const int N = 5e6 + 10;
const int oo = 1e9;
const long double PI = acos(-1);
int n;
int a[101];
int dp[101];
int ppl, ans;
int check() {
  memset(dp, 0, sizeof(dp));
  int pp = 0;
  for (int i = 1; i < n - 1; i++) {
    if (a[i] == 0 && a[i - 1] == 1 && a[i + 1] == 1) {
      dp[i - 1]++;
      dp[i + 1]++;
      pp++;
    }
  }
  return pp;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
  }
  ppl = check();
  for (int i = 0; i < n; i++) {
    if (dp[i] > 1) {
      ans++;
      a[i] = 0;
      ppl = check();
    }
  }
  ans += (ppl > 0 ? ppl : 0);
  cout << ans;
  return 0;
}
