#include <bits/stdc++.h>
using namespace std;
long long n, a[105], g[105][2], c[105][2], b[105][3];
int main() {
  cin >> n;
  for (int i = 0; i <= 104; i++) b[i][0] = 1000, b[i][1] = 1000, b[i][2] = 1000;
  b[0][0] = 0;
  b[0][1] = 0;
  b[0][2] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    b[i][0] = min(b[i - 1][0], min(b[i - 1][1], b[i - 1][2])) + 1;
    if (a[i] == 1 || a[i] == 3) {
      b[i][1] = min(b[i - 1][0], b[i - 1][2]);
    }
    if (a[i] == 2 || a[i] == 3) {
      b[i][2] = min(b[i - 1][0], b[i - 1][1]);
    }
  }
  cout << min(b[n][0], min(b[n][1], b[n][2])) << '\n';
}
