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