#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<vector<int> > dp(n, vector<int>(3, 0));
  int a;
  cin >> a;
  if (a == 3) {
    dp[0][1] = 1;
    dp[0][2] = 1;
  }
  if (a == 1) dp[0][1] = 1;
  if (a == 2) dp[0][2] = 1;
  dp[0][0] = 0;
  for (int i = int(1); i < int(n); i++) {
    int a;
    cin >> a;
    dp[i][0] = max({dp[i - 1][0], dp[i - 1][1], dp[i - 1][2]});
    if (a == 3) {
      dp[i][1] = max(dp[i - 1][0] + 1, dp[i - 1][2] + 1);
      dp[i][2] = max(dp[i - 1][0] + 1, dp[i - 1][1] + 1);
    }
    if (a == 1) {
      dp[i][1] = max(dp[i - 1][0] + 1, dp[i - 1][2] + 1);
    }
    if (a == 2) {
      dp[i][2] = max(dp[i - 1][0] + 1, dp[i - 1][1] + 1);
    }
  }
  int ans = 0;
  for (int i = 0; i < int(3); i++) {
    ans = max(ans, dp[n - 1][i]);
  }
  cout << n - ans << '\n';
}
