#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> v(n + 1);
  for (int i = 1; i <= n; ++i) cin >> v[i];
  vector<vector<long long>> dp(n + 1, vector<long long>(3, 1e18));
  dp[1][0] = 1;
  if (v[1] == 1 || v[1] == 3) dp[1][1] = 0;
  if (v[1] >= 2) dp[1][2] = 0;
  for (int i = 2; i <= n; ++i) {
    if (v[i] == 0) {
      dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
    }
    if (v[i] == 1) {
      dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    }
    if (v[i] == 2) {
      dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    }
    if (v[i] == 3) {
      dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    }
  }
  cout << min(dp[n][0], min(dp[n][1], dp[n][2])) << endl;
  return 0;
}
