#include <bits/stdc++.h>
using namespace std;
stack<time_t> time_stack;
void startTimer() { time_stack.push(clock()); }
double stopTimer() {
  double time = clock() - time_stack.top();
  time_stack.pop();
  return time / double(CLOCKS_PER_SEC);
}
double sqr(double x) { return x * x; }
int main() {
  startTimer();
  ios::sync_with_stdio(false);
  string TASK = "palindrome";
  cout.precision(9);
  cout << fixed;
  int n;
  cin >> n;
  vector<char> cn(n), sp(n);
  for (int i = 0; i < n; i++) {
    int r;
    cin >> r;
    if (r / 2 == 1) sp[i] = true;
    if (r % 2 == 1) cn[i] = true;
  }
  vector<vector<int> > dp(n, vector<int>(3, int(2e9)));
  dp[0][2] = 1;
  if (sp[0])
    if (cn[0]) {
      dp[0][0] = 0;
      dp[0][1] = 0;
    } else {
      dp[0][0] = int(2e9);
      dp[0][1] = 0;
    }
  else if (cn[0]) {
    dp[0][0] = 0;
    dp[0][1] = int(2e9);
  } else {
    dp[0][0] = int(2e9);
    dp[0][1] = int(2e9);
  }
  for (int i = 1; i < n; i++) {
    dp[i][2] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
    if (sp[i])
      if (cn[i]) {
        dp[i][0] = min(dp[i - 1][1], dp[i - 1][2]);
        dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
      } else {
        dp[i][0] = int(2e9);
        dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
      }
    else if (cn[i]) {
      dp[i][0] = min(dp[i - 1][1], dp[i - 1][2]);
      dp[i][1] = int(2e9);
    } else {
      dp[i][0] = int(2e9);
      dp[i][1] = int(2e9);
    }
  }
  cout << min(dp[n - 1][0], min(dp[n - 1][1], dp[n - 1][2]));
  cout << endl;
  return 0;
}
