#include <bits/stdc++.h>
using namespace std;
int dp[101][3];
int main() {
  int n;
  cin >> n;
  fill(dp[0], dp[0] + 3 * 101, 1000000000);
  dp[0][0] = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    dp[i + 1][0] =
        min(dp[i + 1][0], min(dp[i][0], min(dp[i][1], dp[i][2])) + 1);
    if (a & 1) dp[i + 1][1] = min(dp[i + 1][1], min(dp[i][0], dp[i][2]));
    if (a & 2) dp[i + 1][2] = min(dp[i + 1][2], min(dp[i][0], dp[i][1]));
  }
  cout << min(dp[n][0], min(dp[n][1], dp[n][2])) << '\n';
  return 0;
}
