#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int p = 0, v = 0;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++) {
    if (arr[i] == 0 || (arr[i] == 1 && p == 1) || (arr[i] == 2 && p == 2))
      p = 0, v++;
    else if (arr[i] == 1 && p != 1)
      p = 1;
    else if (arr[i] == 2 && p != 2)
      p = 2;
    else if (arr[i] == 3) {
      if (p == 1)
        p = 2;
      else if (p == 2)
        p = 1;
      else if (p == 3 || p == 0)
        p = 0;
    }
  }
  cout << v;
}
