#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return a ? gcd(b % a, a) : b; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, a[105], ct1 = 0, prev1 = 0;
  cin >> n;
  for (long long i = (long long)0; i < (long long)n; i++) {
    cin >> a[i];
  }
  for (long long i = (long long)0; i < (long long)n; i++) {
    if (a[i] == 0) {
      ct1++;
      prev1 = 0;
    } else {
      if (a[i] == 1) {
        if (prev1 == 0) {
          prev1 = 1;
        } else if (prev1 == 1) {
          ct1++;
          prev1 = 0;
        } else if (prev1 == 2) {
          prev1 = 1;
        }
      } else if (a[i] == 2) {
        if (prev1 == 0) {
          prev1 = 2;
        } else if (prev1 == 1) {
          prev1 = 2;
        } else if (prev1 == 2) {
          ct1++;
          prev1 = 0;
        }
      } else if (a[i] == 3) {
        if (prev1 == 0) {
          prev1 = 0;
        } else if (prev1 == 1) {
          prev1 = 2;
        } else if (prev1 == 2) {
          prev1 = 1;
        }
      }
    }
  }
  cout << ct1;
  return 0;
}
