#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int>> a(n);
  vector<int> d(n);
  for (int i = 0; i < n; i++) {
    vector<int> t(3);
    a[i] = t;
    cin >> d[i];
  }
  a[0][0] = 1;
  a[0][1] = 1;
  a[0][2] = 1;
  if (d[0] == 3 || d[0] == 2) a[0][2] = 0;
  if (d[0] == 3 || d[0] == 1) a[0][1] = 0;
  for (int i = 1; i < n; i++) {
    int upMin = min(a[i - 1][0], min(a[i - 1][1], a[i - 1][2]));
    a[i][0] = upMin + 1;
    a[i][1] = upMin + 1;
    a[i][2] = upMin + 1;
    if (d[i] == 3 || d[i] == 2) a[i][2] = min(a[i - 1][0], a[i - 1][1]);
    if (d[i] == 3 || d[i] == 1) a[i][1] = min(a[i - 1][0], a[i - 1][2]);
  }
  cout << min(a[n - 1][0], min(a[n - 1][1], a[n - 1][2]));
  return 0;
}
