#include <bits/stdc++.h>
using namespace std;
int f[105][3];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, i, a;
  cin >> n;
  f[0][0] = f[0][1] = f[0][2] = 0;
  for (i = 1; i <= n; i++) {
    cin >> a;
    f[i][0] = min(f[i - 1][0], min(f[i - 1][1], f[i - 1][2])) + 1;
    if (a == 0)
      f[i][1] = f[i][2] = 1e9;
    else if (a == 1) {
      f[i][1] = min(f[i - 1][0], f[i - 1][2]);
      f[i][2] = 1e9;
    } else if (a == 2) {
      f[i][1] = 1e9;
      f[i][2] = min(f[i - 1][0], f[i - 1][1]);
    } else {
      f[i][1] = min(f[i - 1][0], f[i - 1][2]);
      f[i][2] = min(f[i - 1][0], f[i - 1][1]);
    }
  }
  cout << min(f[n][0], min(f[n][1], f[n][2]));
}
