#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int dp = -1, r = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == 0 || dp == a[i]) {
      r++;
      dp = 0;
    } else {
      if (a[i] == 1) {
        dp = 1;
      } else if (a[i] == 2)
        dp = 2;
      else {
        if (dp == 1)
          dp = 2;
        else if (dp == 2)
          dp = 1;
      }
    }
  }
  cout << r;
  return 0;
}
