#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
const int INF = (int)1e6;
int n;
int a[MAXN];
int dp[MAXN][5];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= 2; j++) {
      if (j == 0) {
        dp[i][j] = 1 + min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2]));
      } else {
        if ((a[i] & j) == 0)
          dp[i][j] = INF;
        else
          dp[i][j] = min(dp[i - 1][0], dp[i - 1][3 - j]);
      }
    }
  }
  int ans = dp[n][0];
  ans = min(ans, min(dp[n][1], dp[n][2]));
  cout << ans << endl;
  return 0;
}
