#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,fma")
using namespace std;
long long ara[110];
long long dp[110][10];
long long n;
long long solve(long long now, long long prev) {
  if (now > n) {
    return 0;
  }
  if (dp[now][prev] != -1) return dp[now][prev];
  long long x = ara[now];
  if (prev == 0) {
    if (x == 0) return dp[now][prev] = 1 + solve(now + 1, 0);
    if (x == 1) return dp[now][prev] = solve(now + 1, 1);
    if (x == 2) return dp[now][prev] = solve(now + 1, 2);
    if (x == 3)
      return dp[now][prev] = min(solve(now + 1, 1), solve(now + 1, 2));
  }
  if (prev == 1) {
    if (x == 0) return dp[now][prev] = 1 + solve(now + 1, 0);
    if (x == 1) return dp[now][prev] = 1 + solve(now + 1, 0);
    if (x == 2) return dp[now][prev] = solve(now + 1, 2);
    if (x == 3) return dp[now][prev] = solve(now + 1, 2);
  }
  if (prev == 2) {
    if (x == 0) return dp[now][prev] = 1 + solve(now + 1, 0);
    if (x == 1) return dp[now][prev] = solve(now + 1, 1);
    if (x == 2) return dp[now][prev] = 1 + solve(now + 1, 0);
    if (x == 3) return dp[now][prev] = solve(now + 1, 1);
  }
}
int main() {
  scanf("%lld", &n);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &ara[i]);
  }
  memset((dp), (-1), sizeof(dp));
  long long ans = solve(1, 0);
  printf("%lld\n", ans);
}
