#include <bits/stdc++.h>
using namespace std;
int dpr[107];
int dps[107];
int dpc[107];
int a[107];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n + 1; i++) scanf("%d", a + i);
  dpr[1] = 1;
  dps[1] = (a[1] == 2 || a[1] == 3) ? 0 : -1;
  dpc[1] = (a[1] == 1 || a[1] == 3) ? 0 : -1;
  for (int i = 2; i < n + 1; i++) {
    dpr[i] = dpr[i - 1];
    if (dps[i - 1] != -1) dpr[i] = min(dpr[i], dps[i - 1]);
    if (dpc[i - 1] != -1) dpr[i] = min(dpr[i], dpc[i - 1]);
    dpr[i] += 1;
    if (a[i] != 2 && a[i] != 3)
      dps[i] = -1;
    else {
      dps[i] = dpr[i - 1];
      if (dpc[i - 1] != -1) dps[i] = min(dps[i], dpc[i - 1]);
    }
    if (a[i] != 1 && a[i] != 3)
      dpc[i] = -1;
    else {
      dpc[i] = dpr[i - 1];
      if (dps[i - 1] != -1) dpc[i] = min(dpc[i], dps[i - 1]);
    }
  }
  int ans = 200;
  ans = min(ans, dpr[n]);
  if (dps[n] != -1) ans = min(ans, dps[n]);
  if (dpc[n] != -1) ans = min(ans, dpc[n]);
  printf("%d\n", ans);
}
