#include <bits/stdc++.h>
using namespace std;
int dp[105][3];
bool gymOpen[105];
bool conOpen[105];
int n, a;
int ans;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    if (a == 0) {
      gymOpen[i] = conOpen[i] = false;
    } else if (a == 1) {
      conOpen[i] = true;
      gymOpen[i] = false;
    } else if (a == 2) {
      conOpen[i] = false;
      gymOpen[i] = true;
    } else {
      gymOpen[i] = conOpen[i] = true;
    }
  }
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i <= n; i++) {
    dp[i][0] = min(dp[i - 1][1], dp[i - 1][2]);
    dp[i][0] = min(dp[i][0], dp[i - 1][0]);
    dp[i][0]++;
    if (!gymOpen[i]) {
      dp[i][1] = 101;
    } else {
      dp[i][1] = min(dp[i - 1][2], dp[i - 1][0]);
    }
    if (!conOpen[i]) {
      dp[i][2] = 101;
    } else {
      dp[i][2] = min(dp[i - 1][1], dp[i - 1][0]);
    }
  }
  ans = 100;
  for (int i = 0; i <= 2; i++) {
    ans = min(ans, dp[n][i]);
  }
  cout << ans << endl;
}
