#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const double eps = 1e-6;
const int mod = 1e9 + 7;
const int maxn = 110;
int n;
int dp[maxn][5];
int a[maxn];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    dp[i][0] = max(max(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]);
    if (a[i] == 1) {
      dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]) + 1;
    } else if (a[i] == 2) {
      dp[i][1] = max(dp[i - 1][0], dp[i - 1][2]) + 1;
    } else if (a[i] == 3) {
      dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]) + 1;
      dp[i][1] = max(dp[i - 1][0], dp[i - 1][2]) + 1;
    }
  }
  cout << n - max(max(dp[n][0], dp[n][1]), dp[n][2]) << endl;
}
