#include <bits/stdc++.h>
using namespace std;
int n, a[105], dp[105][10];
int solve(int day, int i) {
  if (day > n) return 0;
  if (dp[day][i] != -1) return dp[day][i];
  if (i == 0) {
    int zero = solve(day + 1, 0);
    if (a[day + 1] == 1 || a[day + 1] == 3) zero = min(zero, solve(day + 1, 1));
    if (a[day + 1] == 2 || a[day + 1] == 3) zero = min(zero, solve(day + 1, 2));
    return dp[day][i] = zero + (!i);
  } else if (i == 1) {
    int con = solve(day + 1, 0);
    if (a[day + 1] == 2 || a[day + 1] == 3) con = min(con, solve(day + 1, 2));
    return dp[day][i] = con + (!i);
  } else if (i == 2) {
    int gym = solve(day + 1, 0);
    if (a[day + 1] == 1 || a[day + 1] == 3) gym = min(gym, solve(day + 1, 1));
    return dp[day][i] = gym + (!i);
  }
}
int main() {
  cin >> n;
  for (int i = 0; i <= 104; i++)
    for (int j = 0; j <= 9; j++) dp[i][j] = -1;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int ans = solve(1, 0);
  if (a[1] == 1 || a[1] == 3) ans = min(ans, solve(1, 1));
  if (a[1] == 2 || a[1] == 3) ans = min(ans, solve(1, 2));
  cout << ans << "\n";
  return 0;
}
