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