#include <bits/stdc++.h>
using namespace std;
int gym[110], code[110], dp[110][3], n;
int solve(int day, int work) {
  if (day > n) return 0;
  if (dp[day][work] != -1) {
    return dp[day][work];
  }
  int tmp = solve(day + 1, 0) + 1;
  if (code[day] && work != 1) tmp = min(tmp, solve(day + 1, 1));
  if (gym[day] && work != 2) tmp = min(tmp, solve(day + 1, 2));
  return dp[day][work] = tmp;
}
int main() {
  int i;
  cin >> n;
  int a[110];
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) {
    if (a[i] % 2 == 1) code[i] = 1;
    if (a[i] >= 2) gym[i] = 1;
  }
  memset(dp, -1, sizeof(dp));
  cout << solve(1, 0);
  return 0;
}
