#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vi v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  vi rv(n, INT_MAX);
  vi cv(n, INT_MAX);
  vi sv(n, INT_MAX);
  for (int i = 0; i < n; i++) {
    int r = i ? rv[i - 1] : 0;
    int c = i ? cv[i - 1] : 0;
    int s = i ? sv[i - 1] : 0;
    rv[i] = min({r, c, s}) + 1;
    if (v[i] & 1) cv[i] = min(r, s);
    if (v[i] & 2) sv[i] = min(r, c);
  }
  int ans = min({rv[n - 1], cv[n - 1], sv[n - 1]});
  assert(ans != INT_MAX);
  cout << ans << endl;
  return 0;
}
