#include <bits/stdc++.h>
using namespace std;
int memo[101][3];
int n;
int a[101];
int rec(int x, int d) {
  if (x == n) return 0;
  int &ret = memo[x][d];
  if (ret != -1) return ret;
  ret = 1e9;
  if (d != 1 && (a[x] == 2 || a[x] == 3)) ret = min(ret, rec(x + 1, 1));
  if (d != 2 && (a[x] == 1 || a[x] == 3)) ret = min(ret, rec(x + 1, 2));
  ret = min(ret, rec(x + 1, 0) + 1);
  return ret;
}
int main() {
  memset(memo, -1, sizeof(memo));
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  cout << rec(0, 0) << endl;
}
