#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e3 + 5;
long long lps[maxn], dp[maxn][maxn];
signed main() {
  long long n;
  while (~scanf("%lld", &n)) {
    for (long long i = 1; i <= n; i++) scanf("%lld", &lps[i]);
    for (long long i = 1; i <= n; i++)
      for (long long j = 0; j <= 2; j++) dp[i][j] = 0x3f3f3f3f;
    dp[1][0] = 1;
    if (lps[1] == 1) dp[1][1] = 0;
    if (lps[1] == 2) dp[1][2] = 0;
    if (lps[1] == 3) dp[1][1] = dp[1][2] = 0;
    for (long long i = 2; i <= n; i++) {
      dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
      if (lps[i] == 1)
        dp[i][1] = min(dp[i - 1][0], min(dp[i - 1][1] + 1, dp[i - 1][2]));
      else if (lps[i] == 2)
        dp[i][2] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2] + 1));
      else if (lps[i] == 3) {
        dp[i][1] = min(dp[i - 1][0], min(dp[i - 1][1] + 1, dp[i - 1][2]));
        dp[i][2] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2] + 1));
      }
    }
    printf("%lld\n", min(dp[n][0], min(dp[n][1], dp[n][2])));
  }
  return 0;
}
