#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int vacation = 0;
  int last = -1;
  for (int i = 0; i < n; i++) {
    int condition;
    cin >> condition;
    switch (condition) {
      case 0:
        vacation++;
        last = condition;
        break;
      case 1:
        if (last == 1) {
          vacation++;
          last = 0;
        } else
          last = condition;
        break;
      case 2:
        if (last == 2) {
          vacation++;
          last = 0;
        } else
          last = condition;
        break;
      case 3:
        if (last == 0) {
          last = 0;
        } else if (last == 2) {
          last = 1;
        } else if (last == 1) {
          last = 2;
        }
        break;
    }
  }
  cout << vacation;
  return 0;
}
