#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
const int maxn = 100;
const int dx[4] = {1, -1, 0, 0};
const int dy[4] = {0, 0, -1, 1};
int n, A[maxn], dp[maxn][3];
bool gym(int id, int prev) { return A[id] >= 2 && prev != 2; }
bool contest(int id, int prev) { return A[id] % 2 && prev != 1; }
int solve(int id, int p) {
  if (id == n) return 0;
  if (dp[id][p] != -1) return dp[id][p];
  int res = 1 + solve(id + 1, 0);
  if (gym(id, p)) res = min(res, solve(id + 1, 2));
  if (contest(id, p)) res = min(res, solve(id + 1, 1));
  return dp[id][p] = res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  memset(dp, -1, sizeof(dp));
  for (int i = 0; i < n; ++i) cin >> A[i];
  cout << solve(0, 0) << '\n';
}
