#include <bits/stdc++.h>
template <class T>
bool minimize(T &a, T const &b) {
  return a > b ? a = b, 1 : 0;
}
template <class T>
bool maximize(T &a, T const &b) {
  return a < b ? a = b, 1 : 0;
}
using namespace std;
using ll = long long;
using vl = vector<ll>;
using pl = pair<ll, ll>;
using vp = vector<pl>;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
const ll MAX = 1e5 + 5;
ll n, a[101];
void solve() {
  cin >> n;
  for (ll i(1), _b(n); i <= _b; ++i) cin >> a[i];
  vl res;
  for (ll i(2), _b(n - 1); i <= _b; ++i)
    if (a[i - 1] == 1 && a[i + 1] == 1 && a[i] == 0) res.push_back(i);
  if (res.size() == 0) {
    cout << 0;
    return;
  }
  ll ans = res.size();
  for (ll i = 0; i < res.size() - 1;) {
    if (res[i] == res[i + 1] - 2) {
      --ans;
      i += 2;
    } else
      ++i;
  }
  cout << ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int TC = 1;
  for (ll i(1), _b(TC); i <= _b; ++i) {
    solve();
  }
  return 0;
}
