#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int dp[n + 1][3];
  dp[0][0] = 0;
  dp[0][1] = 0;
  dp[0][2] = 0;
  for (int i = 1; i <= n; ++i) {
    int x = min(dp[i - 1][0], dp[i - 1][1]);
    x = min(x, dp[i - 1][2]);
    if (a[i - 1] == 0) {
      dp[i][0] = 1 + x;
      dp[i][1] = INT_MAX;
      dp[i][2] = INT_MAX;
    } else if (a[i - 1] == 1) {
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
      dp[i][2] = INT_MAX;
      dp[i][0] = 1 + x;
    } else if (a[i - 1] == 2) {
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
      dp[i][1] = INT_MAX;
      dp[i][0] = 1 + x;
    } else {
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
      dp[i][0] = INT_MAX;
    }
  }
  int x = min(dp[n][0], dp[n][1]);
  x = min(x, dp[n][2]);
  cout << x;
  return 0;
}
