#include <bits/stdc++.h>
using namespace std;
const int kN = 200;
const int kInf = 1000 * 1000 * 1000;
int dp[kN][3];
vector<int> a;
int DP(int n, int t) {
  if (n == 0) {
    return 0;
  }
  if (t == 1 && a[n - 1] != 1 && a[n - 1] != 3) {
    return kInf;
  }
  if (t == 2 && a[n - 1] != 2 && a[n - 1] != 3) {
    return kInf;
  }
  if (dp[n][t] == -1) {
    dp[n][t] = kInf;
    if (t == 0) {
      dp[n][t] = min(min(DP(n - 1, 0), DP(n - 1, 1)), DP(n - 1, 2)) + 1;
    } else if (t == 1) {
      dp[n][t] = min(DP(n - 1, 2), DP(n - 1, 0));
    } else {
      dp[n][t] = min(DP(n - 1, 1), DP(n - 1, 0));
    }
  }
  return dp[n][t];
}
int main() {
  std::ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  a.resize(n);
  for (int& x : a) {
    cin >> x;
  }
  memset(dp, 255, sizeof(dp));
  int res = min(DP(n, 0), DP(n, 1));
  res = min(res, DP(n, 2));
  cout << res << '\n';
  return 0;
}
