#include <bits/stdc++.h>
int MIN2(int a, int b) { return a < b ? a : b; }
int MIN3(int a, int b, int c) {
  int t = 10000;
  if (t > a) t = a;
  if (t > b) t = b;
  if (t > c) t = c;
  return t;
}
int f[200][5];
int d[200];
int main() {
  int N;
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) scanf("%d", &d[i]);
  f[0][0] = 0;
  f[0][1] = 1000;
  f[0][2] = 1000;
  for (int i = 1; i <= N; i++) {
    if (d[i] == 0) {
      f[i][0] = MIN3(f[i - 1][0], f[i - 1][1], f[i - 1][2]) + 1;
      f[i][1] = 1000;
      f[i][2] = 1000;
    }
    if (d[i] == 1) {
      f[i][0] = MIN3(f[i - 1][0], f[i - 1][1], f[i - 1][2]) + 1;
      f[i][1] = MIN2(f[i - 1][0], f[i - 1][2]);
      f[i][2] = 1000;
    }
    if (d[i] == 2) {
      f[i][0] = MIN3(f[i - 1][0], f[i - 1][1], f[i - 1][2]) + 1;
      f[i][1] = 1000;
      f[i][2] = MIN2(f[i - 1][0], f[i - 1][1]);
    }
    if (d[i] == 3) {
      f[i][0] = MIN3(f[i - 1][0], f[i - 1][1], f[i - 1][2]) + 1;
      f[i][1] = MIN2(f[i - 1][0], f[i - 1][2]);
      f[i][2] = MIN2(f[i - 1][0], f[i - 1][1]);
    }
  }
  printf("%d\n", MIN3(f[N][0], f[N][1], f[N][2]));
  return 0;
}
