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