#include <bits/stdc++.h>

using namespace std;

/*
   vacations(d, last) answers to distance d ending with character last
*/
int vacations(int d, char last, vector<int> &days) {
   if (d == 0) return 0;

   int cur = days[days.size() - d];
   int best = INT_MAX;
   if (last == 'R') {
      if (cur == 3 || cur == 4) {
         best = vacations(d - 1, 'G', days);
      }
      if (cur == 2 || cur == 4) {
         best = min(best, vacations(d - 1, 'C', days));
      }
      best = min(best, vacations(d - 1, 'R', days) + 1);
   } else if (last == 'C') {
      if (cur == 3 || cur == 4) {
         best = vacations(d - 1, 'G', days);
      }
      best = min(best, vacations(d - 1, 'R', days) + 1);
   } else if (last == 'G') {
      if (cur == 2 || cur == 4) {
         best = min(best, vacations(d - 1, 'C', days));
      }
      best = min(best, vacations(d - 1, 'R', days) + 1);
   }

   return best;
}

int main(){
   int n; cin >> n;
   vector<int> A(n);
   for (int i = 0; i < n; i++) {
      cin >> A[i];
      A[i]++;
   }
   cout << min({vacations(n, 'R', A) + 1, vacations(n, 'C', A), vacations(n, 'G', A)}) << endl;
   return 0;
}