#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int M = 1e6 + 10;
const int MOD = 1e9 + 7;
double const pi = acos(-1);
const double eps = 1e-8;
void fre() { freopen("in.txt", "r", stdin); }
int a[105];
int main() {
  int n;
  int ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] == 0) ans++;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0)
      continue;
    else if ((a[i] == 2 && a[i - 1] == 1) || (a[i] == 2 && a[i - 1] == 1))
      continue;
    else if (a[i] == 1 && a[i - 1] == 1) {
      a[i] = 0;
      ans++;
      continue;
    } else if (a[i] == 2 && a[i - 1] == 2) {
      a[i] = 0;
      ans++;
      continue;
    } else if (a[i] == 3 && a[i - 1] == 1) {
      a[i] = 2;
      continue;
    } else if (a[i] == 3 && a[i - 1] == 2) {
      a[i] = 1;
      continue;
    }
  }
  printf("%d\n", ans);
  return 0;
}
