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