#include <bits/stdc++.h>
using namespace std;
const int N = 105;
const int INF = 0x3f3f3f3f;
int dp[N][3];
int a[N], n;
int main() {
  while (~scanf("%d", &n)) {
    memset(dp, 0, sizeof(dp));
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    dp[1][0] = 1;
    dp[1][1] = (a[1] >= 2) ? 0 : INF;
    dp[1][2] = (a[1] == 1 || a[1] == 3) ? 0 : INF;
    for (int i = 2; i <= n; i++) {
      dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
      if (a[i] >= 2)
        dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
      else
        dp[i][1] = INF;
      if (a[i] == 1 || a[i] == 3)
        dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
      else
        dp[i][2] = INF;
    }
    printf("%d\n", min(dp[n][0], min(dp[n][1], dp[n][2])));
  }
  return 0;
}
