#include <bits/stdc++.h>
using namespace std;
long long int powmod(long long int a, long long int b) {
  if (b == 0) return 1;
  long long int x = powmod(a, b / 2);
  long long int y = (x * x) % 1000000007;
  if (b % 2) return (a * y) % 1000000007;
  return y % 1000000007;
}
int dp[110][4];
int a[110];
int n;
int rec(int i, int prev) {
  if (i == n) return 0;
  if (dp[i][prev] != -1) return dp[i][prev];
  int ret = 1000000007;
  if (a[i] == 0)
    ret = min(ret, 1 + rec(i + 1, 0));
  else if (a[i] == 1) {
    ret = min(ret, 1 + rec(i + 1, 0));
    if (prev != 1) ret = min(ret, rec(i + 1, 1));
  } else if (a[i] == 2) {
    ret = min(ret, 1 + rec(i + 1, 0));
    if (prev != 2) ret = min(ret, rec(i + 1, 2));
  } else if (a[i] == 3) {
    ret = min(ret, 1 + rec(i + 1, 0));
    if (prev != 1) ret = min(ret, rec(i + 1, 1));
    if (prev != 2) ret = min(ret, rec(i + 1, 2));
  }
  dp[i][prev] = ret;
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  memset(dp, -1, sizeof(dp));
  int ans = rec(0, 0);
  printf("%d\n", ans);
  return 0;
}
