#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000;
const int inf = 0x3f3f3f3f;
int arr[maxn];
int dp[maxn][4];
int getmin1(int a, int b, int c, int d) {
  int x = a < b ? a : b;
  x = x < c ? x : c;
  return x < d ? x : d;
}
int getmin(int a, int b, int c) {
  int x = a < b ? a : b;
  return x < c ? x : c;
}
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    memset(dp, inf, sizeof(dp));
    for (int i = 1; i <= n; i++) scanf("%d", &arr[i]);
    if (arr[1] == 0)
      dp[1][1] = dp[1][3] = 1;
    else if (arr[1] == 1)
      dp[1][1] = 1, dp[1][2] = 0;
    else if (arr[1] == 2)
      dp[1][0] = 0, dp[1][3] = 1;
    else
      dp[1][0] = dp[1][2] = 0;
    for (int i = 2; i <= n; i++) {
      if (arr[i] == 0) {
        dp[i][1] = dp[i][3] =
            getmin1(dp[i - 1][0], dp[i - 1][1], dp[i - 1][2], dp[i - 1][3]) + 1;
      } else if (arr[i] == 1) {
        dp[i][1] =
            getmin1(dp[i - 1][0], dp[i - 1][1], dp[i - 1][2], dp[i - 1][3]) + 1;
        dp[i][2] = getmin(dp[i - 1][0], dp[i - 1][1], dp[i - 1][3]);
      } else if (arr[i] == 2) {
        dp[i][0] = getmin(dp[i - 1][1], dp[i - 1][2], dp[i - 1][3]);
        dp[i][3] =
            getmin1(dp[i - 1][0], dp[i - 1][1], dp[i - 1][2], dp[i - 1][3]) + 1;
      } else {
        dp[i][0] = getmin(dp[i - 1][1], dp[i - 1][2], dp[i - 1][3]);
        dp[i][2] = getmin(dp[i - 1][0], dp[i - 1][1], dp[i - 1][3]);
      }
    }
    int min_ = inf;
    for (int i = 0; i <= 3; i++)
      if (dp[n][i] < min_) min_ = dp[n][i];
    printf("%d\n", min_);
  }
}
