#include <bits/stdc++.h>
using namespace std;
int dp[1010][5], a[1010];
int main() {
  int n;
  memset(dp, 0x3f3f3f3f, sizeof(dp));
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  dp[1][0] = 1;
  if (a[1] == 1)
    dp[1][2] = 0;
  else if (a[1] == 2)
    dp[1][1] = 0;
  else if (a[1] == 3)
    dp[1][1] = dp[1][2] = 0;
  for (int i = 2; 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) {
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    } else if (a[i] == 2) {
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    } else if (a[i] == 3) {
      dp[i][1] = min(dp[i - 1][2], dp[i - 1][0]);
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    }
  }
  printf("%d\n", min(dp[n][0], min(dp[n][1], dp[n][2])));
  return 0;
}
