#include <bits/stdc++.h>
using namespace std;
int n;
int arr[200], dp[4][200];
int solve(int p, int c) {
  if (dp[p][c] != -1) return dp[p][c];
  if (c == n) return 0;
  if (arr[c] == 0)
    return dp[p][c] = 1 + solve(0, c + 1);
  else if (arr[c] == 3) {
    if (p == 0)
      return dp[p][c] = min(solve(2, c + 1), solve(1, c + 1));
    else if (p == 1)
      return dp[p][c] = min(solve(2, c + 1), 1 + solve(0, c + 1));
    else
      return dp[p][c] = min(solve(1, c + 1), 1 + solve(0, c + 1));
  } else if (p == arr[c] && p != 0)
    return dp[p][c] = 1 + solve(0, c + 1);
  else
    return dp[p][c] = min(solve(arr[c], c + 1), 1 + solve(0, c + 1));
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  memset(dp, -1, sizeof(dp));
  cout << solve(0, 0) << endl;
  return 0;
}
