#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, val, temp, rest = 0, curr = 3;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> val;
    temp = curr & val;
    if (temp == 0) {
      curr = 3;
      rest++;
    } else if (temp == 1)
      curr = 2;
    else if (temp == 2)
      curr = 1;
  }
  cout << rest;
  return 0;
}
