#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int dp[N][3], n;
int main() {
  int i, a;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a;
    if (i == 1) {
      if (a == 1) dp[1][1] = 1;
      if (a == 2) dp[1][2] = 1;
      if (a == 3) dp[1][1] = dp[1][2] = 1;
      continue;
    }
    if (a == 1) dp[i][1] = max(dp[i - 1][2], dp[i - 1][0]) + 1;
    if (a == 2) dp[i][2] = max(dp[i - 1][1], dp[i - 1][0]) + 1;
    if (a == 3) {
      dp[i][1] = max(dp[i - 1][2], dp[i - 1][0]) + 1;
      dp[i][2] = max(dp[i - 1][1], dp[i - 1][0]) + 1;
    }
    dp[i][0] = max(max(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]);
  }
  cout << n - max(max(dp[n][0], dp[n][1]), dp[n][2]);
  return 0;
}
