#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100;
int N, D[3][MAX_N + 5], A[MAX_N + 5], ans;
int main() {
  int i, j;
  scanf("%d", &N);
  for (i = 1; i <= N; i++) scanf("%d", A + i);
  for (i = 1; i <= N; i++) D[0][i] = D[1][i] = D[2][i] = 2e9;
  if (A[1] == 0)
    D[0][1] = 1;
  else if (A[1] == 1)
    D[0][1] = 1, D[1][1] = 0;
  else if (A[1] == 2)
    D[0][1] = 1, D[2][1] = 0;
  else if (A[1] == 3)
    D[0][1] = 1, D[1][1] = D[2][1] = 0;
  for (i = 1; i < N; i++) {
    for (j = 0; j < 3; j++)
      if (D[j][i] != 2e9) {
        D[0][i + 1] = min(D[0][i + 1], D[j][i] + 1);
        if (A[i + 1] == 1 || A[i + 1] == 3)
          if (j != 1) D[1][i + 1] = min(D[1][i + 1], D[j][i]);
        if (A[i + 1] == 2 || A[i + 1] == 3)
          if (j != 2) D[2][i + 1] = min(D[2][i + 1], D[j][i]);
      }
  }
  ans = min(D[0][N], min(D[1][N], D[2][N]));
  printf("%d", ans);
  return 0;
}
