#include <bits/stdc++.h>
const double PI = acos(-1.0);
const double e = exp(1.0);
const int INF = 0x7fffffff;
;
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
inline T Min(T a, T b) {
  return a < b ? a : b;
}
template <class T>
inline T Max(T a, T b) {
  return a > b ? a : b;
}
bool cmpbig(int a, int b) { return a > b; }
bool cmpsmall(int a, int b) { return a < b; }
using namespace std;
int dp[110][5];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    for (int i = 0; i <= n; i++) dp[i][0] = dp[i][1] = dp[i][2] = INF;
    dp[0][0] = dp[0][1] = dp[0][2] = 0;
    int pos;
    for (int i = 1; i <= n; i++) {
      int pos1 = min(dp[i - 1][1], dp[i - 1][2]);
      scanf("%d", &pos);
      dp[i][0] = min(dp[i - 1][0], pos1) + 1;
      if (pos == 2 || pos == 3) dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
      if (pos == 1 || pos == 3) dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    }
    int min_num = min(dp[n][0], min(dp[n][1], dp[n][2]));
    printf("%d\n", min_num);
  }
  return 0;
}
