#include <bits/stdc++.h>
using namespace std;
int hcaosndsag;
int n, dp[110][5], arr[110], flag[110];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  for (int i = 1; i <= n; i++) {
    if (arr[i] == 0) {
      dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
      dp[i][1] = dp[i][2] = 110;
    } else if (arr[i] == 1) {
      dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
      dp[i][2] = 110;
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    } else if (arr[i] == 2) {
      dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
      dp[i][1] = 110;
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    } else {
      dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
      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;
  return 0;
}
