#include <bits/stdc++.h>
using namespace std;
int vac[101];
int g[101];
int c[101];
int r[101];
int main() {
  int n;
  cin >> n;
  memset(g, 0, 101 * sizeof(int));
  memset(c, 0, 101 * sizeof(int));
  memset(c, 0, 101 * sizeof(int));
  for (int i = 1; i <= n; i++) cin >> vac[i];
  for (int i = 1; i <= n; i++) {
    g[i] = max(g[i], 1);
    g[i] = max(g[i], r[i - 1] + 1);
    g[i] = max(g[i], c[i - 1] + 1);
    c[i] = max(c[i], 1);
    c[i] = max(c[i], r[i - 1] + 1);
    c[i] = max(c[i], g[i - 1] + 1);
    r[i] = r[i - 1];
    r[i] = max(r[i], g[i - 1]);
    r[i] = max(r[i], c[i - 1]);
    if (vac[i] == 0) {
      g[i] = 0;
      c[i] = 0;
    } else if (vac[i] == 1) {
      g[i] = 0;
    } else if (vac[i] == 2) {
      c[i] = 0;
    }
  }
  int m = r[n];
  m = max(m, g[n]);
  m = max(m, c[n]);
  cout << n - m << endl;
  return 0;
}
