#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 2;
const int mod = 1e9 + 7;
int n;
int arr[N];
int dp[100][3];
int solve(int i, int last) {
  if (i == n) return 0;
  int &ret = dp[i][last];
  if (ret != -1) return ret;
  ret = 1e9;
  if (arr[i] == 0) ret = 1 + solve(i + 1, 0);
  if (arr[i] == 1 && last != 1) {
    ret = solve(i + 1, 1);
  } else if (arr[i] == 1 && last == 1)
    ret = 1 + solve(i + 1, 0);
  if (arr[i] == 2 && last != 2) {
    ret = solve(i + 1, 2);
  } else if (arr[i] == 2 && last == 2)
    ret = 1 + solve(i + 1, 0);
  if (arr[i] == 3 && last == 1) {
    ret = solve(i + 1, 2);
  } else if (arr[i] == 3 && last == 2)
    ret = solve(i + 1, 1);
  else if (arr[i] == 3)
    ret = min(solve(i + 1, 1), solve(i + 1, 2));
  return ret;
}
int main() {
  memset(dp, -1, sizeof dp);
  scanf("%d", &n);
  for (int i = 0; i < (int)(n); ++i) scanf("%d", arr + i);
  printf("%d\n", solve(0, 0));
  return 0;
}
