#include <bits/stdc++.h>
const int INF = 0x7F7F7F7F;
const double EPS = 1e-10;
const long long mod7 = 1e9 + 7;
const long long mod9 = 1e9 + 9;
using namespace std;
inline long long rit() {
  long long f = 0, key = 1;
  char c;
  do {
    c = getchar();
    if (c == '-') key = -1;
  } while (c < '0' || c > '9');
  do {
    f = f * 10 + c - '0';
    c = getchar();
  } while (c >= '0' && c <= '9');
  return f * key;
}
void init() {}
int dp[105][3];
int a[105], n;
void read() {
  int i;
  n = rit();
  for (i = 1; i <= n; i++) a[i] = rit();
}
void solve() {
  int i;
  for (i = 1; i <= n; i++) {
    dp[i][0] = min(dp[i - 1][0] + 1, min(dp[i - 1][1] + 1, dp[i - 1][2] + 1));
    if (a[i] == 1 || a[i] == 3)
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    else
      dp[i][1] = INF;
    if (a[i] == 2 || a[i] == 3)
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    else
      dp[i][2] = INF;
  }
  cout << min(dp[n][0], min(dp[n][1], dp[n][2])) << endl;
}
int main() {
  int nn = 1;
  init();
  while (nn--) {
    read();
    solve();
  }
  return 0;
}
