#include <bits/stdc++.h>
using namespace std;
const int N = 110;
const int inf = 0x3f3f3f3f;
int arr[N][4];
int t;
int ans;
int n;
int mymin(int a, int b, int c) { return min(a, min(b, c)); }
int main() {
  cin >> n;
  ans = n;
  for (int i = 1; i <= n; i++) {
    cin >> t;
    if (t == 0) {
      arr[i][1] = mymin(arr[i - 1][1], arr[i - 1][2], arr[i - 1][3]) + 1;
      arr[i][2] = arr[i][3] = inf;
    }
    if (t == 1) {
      arr[i][2] = min(arr[i - 1][1], arr[i - 1][3]);
      arr[i][1] = mymin(arr[i - 1][1], arr[i - 1][2], arr[i - 1][3]) + 1;
      arr[i][3] = inf;
    }
    if (t == 2) {
      arr[i][3] = min(arr[i - 1][1], arr[i - 1][2]);
      arr[i][1] = mymin(arr[i - 1][1], arr[i - 1][2], arr[i - 1][3]) + 1;
      arr[i][2] = inf;
    }
    if (t == 3) {
      arr[i][2] = min(arr[i - 1][1], arr[i - 1][3]);
      arr[i][3] = min(arr[i - 1][1], arr[i - 1][2]);
      arr[i][1] = mymin(arr[i - 1][1], arr[i - 1][2], arr[i - 1][3]) + 1;
    }
  }
  cout << mymin(arr[n][1], arr[n][2], arr[n][3]) << endl;
  return 0;
}
