#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, a[100], d[100], j, c = 0;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  if (a[0] == 0)
    d[0] = 0;
  else if (a[0] == 1)
    d[0] = 1;
  else if (a[0] == 2)
    d[0] = 2;
  else if (a[0] == 3) {
    i = 0;
    j = i;
    while (a[j] == 3 && j < n) j++;
    if (a[j] == 0 || j == n)
      d[i] = 2;
    else if (a[j] == 1) {
      if ((j - i) % 2 == 0)
        d[i] = 1;
      else
        d[i] = 2;
    } else if (a[j] == 2) {
      if ((j - i) % 2 == 0)
        d[i] = 2;
      else
        d[i] = 1;
    }
  }
  for (i = 1; i < n; i++) {
    if (a[i] == 0)
      d[i] = 0;
    else if (a[i] == 1) {
      if (d[i - 1] != 1)
        d[i] = 1;
      else
        d[i] = 0;
    } else if (a[i] == 2) {
      if (d[i - 1] != 2)
        d[i] = 2;
      else
        d[i] = 0;
    } else if (a[i] == 3) {
      if (d[i - 1] == 2)
        d[i] = 1;
      else if (d[i - 1] == 1)
        d[i] = 2;
      else {
        j = i;
        while (a[j] == 3 && j < n) j++;
        if (a[j] == 0 || j == n)
          d[i] = 2;
        else if (a[j] == 1) {
          if ((j - i) % 2 == 0)
            d[i] = 1;
          else
            d[i] = 2;
        } else if (a[j] == 2) {
          if ((j - i) % 2 == 0)
            d[i] = 2;
          else
            d[i] = 1;
        }
      }
    }
  }
  for (i = 0; i < n; i++)
    if (d[i] == 0) c++;
  cout << c;
}
