#include <bits/stdc++.h>
using namespace std;
int a[1000], n;
int dp[104][10];
int solve(int day, int previous_state) {
  if (day == n + 1) return 0;
  if (dp[day][previous_state] != -1) return dp[day][previous_state];
  int ans1, ans2, ans3;
  ans1 = ans2 = ans3 = 2000000000;
  ans1 = 1 + solve(day + 1, 1);
  if (previous_state != 2 && a[day] != 0 && a[day] != 2)
    ans2 = solve(day + 1, 2);
  if (previous_state != 3 && a[day] != 0 && a[day] != 1)
    ans3 = solve(day + 1, 3);
  return dp[day][previous_state] = min(ans1, min(ans2, ans3));
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  memset(dp, -1, sizeof(dp));
  cout << solve(1, -1) << endl;
}
