#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-7;
int a[110];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int p = 0, pre = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) p++, pre = 0;
    if (a[i] == 1) {
      if (pre == 1)
        p++, pre = 0;
      else
        pre = 1;
    }
    if (a[i] == 2) {
      if (pre == 2)
        p++, pre = 0;
      else
        pre = 2;
    }
    if (a[i] == 3) {
      if (pre == 1)
        pre = 2;
      else if (pre == 2)
        pre = 1;
      else
        pre = 0;
    }
  }
  cout << p << endl;
}
