#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000;
int f0[200], f1[200], f2[200], g[200];
int i, n;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &g[i]);
  for (i = 1; i <= n; i++) {
    if (g[i] & 1)
      f1[i] = min(f0[i - 1], f2[i - 1]);
    else
      f1[i] = inf;
    if (g[i] & 2)
      f2[i] = min(f0[i - 1], f1[i - 1]);
    else
      f2[i] = inf;
    f0[i] = min(min(f1[i - 1], f2[i - 1]), f0[i - 1]) + 1;
  }
  printf("%d", min(min(f1[n], f2[n]), f0[n]));
  return 0;
}
