#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  int a[101], kt[101] = {}, f[101][4] = {};
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    f[i][0] = max(f[i - 1][0], max(f[i - 1][1], f[i - 1][2]));
    if (a[i] == 2 || a[i] == 3) {
      f[i][2] = max(f[i][2], max(f[i][2], max(f[i - 1][1], f[i - 1][0]) + 1));
    }
    if (a[i] == 1 || a[i] == 3) {
      f[i][1] = max(f[i][1], max(f[i][1], max(f[i - 1][2], f[i - 1][0]) + 1));
    }
  }
  int ma = 0;
  for (int i = 0; i <= 2; i++) {
    for (int j = 1; j <= n; j++) ma = max(ma, f[j][i]);
  }
  cout << n - ma;
  return 0;
}
