#include <bits/stdc++.h>
using namespace std;
int ar[101];
int dp[101][3];
int n;
int rek(int cur, int last) {
  if (cur == n) return 0;
  if (dp[cur][last] == -1) {
    int rez = 1010;
    if (ar[cur] & 1 && last != 1) rez = min(rez, rek(cur + 1, 1));
    if (ar[cur] & 2 && last != 2) rez = min(rez, rek(cur + 1, 2));
    rez = min(rez, 1 + rek(cur + 1, 0));
    dp[cur][last] = rez;
  }
  return dp[cur][last];
}
int main() {
  memset(dp, -1, sizeof(dp));
  cin >> n;
  for (int ctr1 = 0; ctr1 < n; ctr1++) cin >> ar[ctr1];
  cout << rek(0, 0);
  return 0;
}
