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