#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 110;
const int REST = 0;
const int SPORT = 1;
const int CONTEST = 2;
const int MY_INF = 100000;
int main() {
  int n = 0;
  int a[MAX_N] = {0}, ans[MAX_N][3] = {0};
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < n; i++) {
    ans[i + 1][REST] =
        min(min(ans[i][REST], ans[i][SPORT]), ans[i][CONTEST]) + 1;
    if (a[i] & 1) {
      ans[i + 1][SPORT] = min(ans[i][REST], ans[i][CONTEST]);
    } else {
      ans[i + 1][SPORT] = MY_INF;
    }
    if (a[i] & (1 << 1)) {
      ans[i + 1][CONTEST] = min(ans[i][REST], ans[i][SPORT]);
    } else {
      ans[i + 1][CONTEST] = MY_INF;
    }
  }
  printf("%d\n", min(min(ans[n][REST], ans[n][SPORT]), ans[n][CONTEST]));
  return 0;
}
