#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 9;
const int mod = 1e9 + 7;
long long dp[101][10], n, ar[101];
long long solve(long long now, long long prev) {
  if (now > n) return 0;
  if (dp[now][prev] != -1) {
    return dp[now][prev];
  }
  if (prev == 0) {
    if (ar[now] == 0) return dp[now][prev] = 1 + solve(now + 1, 0);
    if (ar[now] == 1) return dp[now][prev] = solve(now + 1, 1);
    if (ar[now] == 2) return dp[now][prev] = solve(now + 1, 2);
    if (ar[now] == 3)
      return dp[now][prev] = min(solve(now + 1, 1), solve(now + 1, 2));
  }
  if (prev == 1) {
    if (ar[now] == 0) return dp[now][prev] = 1 + solve(now + 1, 0);
    if (ar[now] == 1) return dp[now][prev] = 1 + solve(now + 1, 0);
    if (ar[now] == 2) return dp[now][prev] = solve(now + 1, 2);
    if (ar[now] == 3) return dp[now][prev] = solve(now + 1, 2);
  }
  if (prev == 2) {
    if (ar[now] == 0) return dp[now][prev] = 1 + solve(now + 1, 0);
    if (ar[now] == 1) return dp[now][prev] = solve(now + 1, 1);
    if (ar[now] == 2) return dp[now][prev] = 1 + solve(now + 1, 0);
    if (ar[now] == 3) return dp[now][prev] = solve(now + 1, 1);
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int i, cnt = 0;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> ar[i];
  memset(dp, -1, sizeof(dp));
  long long ans = solve(1, 0);
  cout << ans << '\n';
}
