#include <bits/stdc++.h>
using namespace std;
int status[110];
int d[110][3];
int n;
void init() {
  for (int i = 0; i < 110; ++i) {
    for (int j = 0; j < 3; ++j) {
      d[i][j] = 0;
    }
  }
}
int dp() {
  init();
  for (int i = 1; i <= n; ++i) {
    if (status[i] == 1 || status[i] == 3)
      d[i][1] = max(d[i - 1][0], d[i - 1][2]) + 1;
    if (status[i] == 2 || status[i] == 3)
      d[i][2] = max(d[i - 1][0], d[i - 1][1]) + 1;
    d[i][0] = max(max(d[i - 1][0], d[i - 1][1]), d[i - 1][2]);
  }
  return n - max(max(d[n][0], d[n][1]), d[n][2]);
}
int main() {
  while (cin >> n) {
    for (int i = 1; i <= n; ++i) {
      cin >> status[i];
    }
    cout << dp() << endl;
  }
  return 0;
}
