#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[100];
  int min_r[101][3];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  min_r[0][0] = min_r[0][1] = min_r[0][2] = 0;
  for (int d = 0; d < n; ++d) {
    min_r[d + 1][0] = min_r[d + 1][1] = 1e9;
    if (a[d] / 2 == 1) {
      min_r[d + 1][0] = min(min_r[d + 1][0], min(min_r[d][1], min_r[d][2]));
    }
    if (a[d] % 2 == 1) {
      min_r[d + 1][1] = min(min_r[d + 1][1], min(min_r[d][0], min_r[d][2]));
    }
    min_r[d + 1][2] = min(min_r[d][0], min(min_r[d][1], min_r[d][2])) + 1;
  }
  cout << min(min_r[n][0], min(min_r[n][1], min_r[n][2])) << endl;
  return 0;
}
