#include <bits/stdc++.h>
using namespace std;
int a[102], dp[102][5];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  dp[0][0] = 0;
  dp[0][1] = 0;
  dp[2][0] = 0;
  for (int i = 1; i <= n; i++) {
    dp[i][0] = max(dp[i - 1][0], max(dp[i - 1][1], dp[i - 1][2]));
    if (a[i] == 1 || a[i] == 3) {
      dp[i][1] = max(dp[i - 1][0], dp[i - 1][2]) + 1;
    } else
      dp[i][1] = dp[i - 1][1];
    if (a[i] == 2 || a[i] == 3) {
      dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]) + 1;
    } else
      dp[i][2] = dp[i - 1][2];
  }
  cout << (n - max(dp[n][0], max(dp[n][1], dp[n][2]))) << '\n';
}
