#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const int N = 105;
const int M = 1005;
const int inf = 1000000007;
const int mod = 1000000007;
int s[N], dp[N][3];
int main() {
  int n, i, j;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &s[i]);
    for (j = 0; j < 3; j++) dp[i][j] = inf;
  }
  for (i = 1; i <= n; i++) {
    if (s[i] == 0)
      dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + 1;
    else if (s[i] == 1) {
      dp[i][1] = min(dp[i - 1][1] + 1, min(dp[i - 1][0], dp[i - 1][2]));
      dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + 1;
    } else if (s[i] == 2) {
      dp[i][2] = min(dp[i - 1][2] + 1, min(dp[i - 1][0], dp[i - 1][1]));
      dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + 1;
    } else {
      dp[i][1] = min(dp[i - 1][1] + 1, min(dp[i - 1][0], dp[i - 1][2]));
      dp[i][2] = min(dp[i - 1][2] + 1, min(dp[i - 1][0], dp[i - 1][1]));
      dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + 1;
    }
  }
  printf("%d\n", min(min(dp[n][0], dp[n][1]), dp[n][2]));
  return 0;
}
