#include <bits/stdc++.h>
using namespace std;
int n;
int A[1000];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i];
  int G = 0, C = 0;
  for (int i = 0; i < n; i++) {
    if (A[i] == 0) {
      G = min(C, G) + 1;
      C = G;
    } else if (A[i] == 1) {
      int temp = G;
      G = min(G, C) + 1;
      C = min(temp, C + 1);
    } else if (A[i] == 2) {
      int temp = C;
      C = min(G, C) + 1;
      G = min(temp, G + 1);
    } else {
      int temp = G;
      G = min(C, G + 1);
      C = min(temp, C + 1);
    }
  }
  cout << min(G, C) << endl;
}
