#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  vector<vector<int>> dp(n + 1, vector<int>(3));
  for (int i = 1; i <= n; i++) {
    dp[i][0] = max(dp[i - 1][0], max(dp[i - 1][1], dp[i - 1][2]));
    if (arr[i - 1] == 1) {
      dp[i][1] = 1 + max(dp[i - 1][2], dp[i - 1][0]);
    } else if (arr[i - 1] == 2) {
      dp[i][2] = 1 + max(dp[i - 1][1], dp[i - 1][0]);
    } else if (arr[i - 1] == 3) {
      dp[i][1] = 1 + max(dp[i - 1][2], dp[i - 1][0]);
      dp[i][2] = 1 + max(dp[i - 1][1], dp[i - 1][0]);
    }
  }
  int ans = n - *max_element(dp[n].begin(), dp[n].end());
  cout << ans << endl;
}
