#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, counter = 0, s, e, prev;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  prev = a[0];
  if (prev == 0) counter++;
  for (int i = 1; i < n; i++) {
    if (a[i] == 0)
      counter++;
    else if (a[i] == 3) {
      if (a[i - 1] == 3 || a[i - 1] == 0) {
        prev = a[i];
        continue;
      } else if (a[i - 1] == 1)
        a[i] = 2;
      else if (a[i - 1] == 2)
        a[i] = 1;
    } else {
      if (a[i - 1] == a[i]) {
        a[i] = 0;
        counter++;
      }
    }
    prev = a[i];
  }
  cout << counter;
  return 0;
}
