#include <bits/stdc++.h>
using namespace std;
clock_t startTime;
int max(int a, int b, int c) {
  if (a > b)
    return max(a, c);
  else
    return max(b, c);
}
int main() {
  srand(time(NULL));
  startTime = clock();
  ios_base::sync_with_stdio(false), cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n + 1);
  for (long long i = (0); i < (n); ++i) cin >> a[i + 1];
  int dp[101][3];
  dp[0][0] = dp[0][1] = dp[0][2] = 0;
  for (long long i = (1); i < (n + 1); ++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] + 1, 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] + 1, 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]));
  return 0;
}
