#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int INF = 0x3f3f3f3f;
const int MAXN = 100 + 10;
int a[MAXN];
int dis[MAXN];
void init() {
  memset(a, 0, sizeof(a));
  memset(dis, INF, sizeof(dis));
}
int main() {
  int N;
  while (~scanf("%d", &N)) {
    init();
    int tot = 0;
    for (int i = 1; i <= N; i++) {
      scanf("%d", &a[i]);
    }
    for (int i = 1; i <= N - 1; i++) {
      if (a[i - 1] == 1 && a[i + 1] == 1 && a[i] == 0) {
        dis[tot++] = i;
      }
    }
    int ans = 0;
    int flag = 0;
    for (int i = 0; i < tot; i++) {
      if (dis[i + 1] - dis[i] <= 2 && flag == 0) {
        ans--;
        ans++;
        flag = 1;
        continue;
      }
      flag = 0;
      ans++;
    }
    printf("%d\n", ans);
  }
  return 0;
}
