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