#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<vector<int> > dp(n, vector<int>(3, INF));
  if (a[0] == 0) dp[0][0] = 1;
  if (a[0] == 1 || a[0] == 3) dp[0][1] = 0;
  if (a[0] == 2 || a[0] == 3) dp[0][2] = 0;
  for (int i = 1; i < n; i++) {
    dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + 1;
    if (a[i] == 1 || a[i] == 3) dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    if (a[i] == 2 || a[i] == 3) dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
  }
  cout << min(min(dp[n - 1][0], dp[n - 1][1]), dp[n - 1][2]);
  return 0;
}
