#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a;
  int l = 0;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if ((a == 1 && l == 1) | (a == 2 && l == 2) | (a == 0)) {
      cnt++;
      l = 0;
    } else if (a == 3) {
      if (l == 1)
        l = 2;
      else if (l == 2)
        l = 1;
      else
        l = 0;
    } else
      l = a;
  }
  cout << cnt;
  return 0;
}
