#include <bits/stdc++.h>
using namespace std;
int a[1000], f[1000][3];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    f[i][0] = max(f[i - 1][0], max(f[i - 1][1], f[i - 1][2]));
    if (a[i] & 1) f[i][1] = max(f[i - 1][0], f[i - 1][2]) + 1;
    if (a[i] & 2) f[i][2] = max(f[i - 1][0], f[i - 1][1]) + 1;
  }
  cout << n - max(f[n][0], max(f[n][1], f[n][2]));
  return 0;
}
