#include <bits/stdc++.h>
using namespace std;
vector<int> a;
int dp[107][3];
int rec(int i, int prev) {
  if (dp[i][prev] != -1) return dp[i][prev];
  if (i == a.size())
    dp[i][prev] = 0;
  else if (a[i] == 0)
    dp[i][prev] = 1 + rec(i + 1, 0);
  else if (prev == a[i] && a[i] != 3)
    dp[i][prev] = 1 + rec(i + 1, 0);
  else if (prev == 0 && a[i] == 3)
    dp[i][prev] = min(rec(i + 1, 1), rec(i + 1, 2));
  else if (prev == 0)
    dp[i][prev] = rec(i + 1, a[i]);
  else {
    if (prev == 1)
      dp[i][prev] = rec(i + 1, 2);
    else if (prev == 2)
      dp[i][prev] = rec(i + 1, 1);
  }
  return dp[i][prev];
}
void initialize() {
  for (int i = 0; i < 107; i++) {
    for (int j = 0; j < 3; j++) dp[i][j] = -1;
  }
}
int main() {
  int n;
  cin >> n;
  initialize();
  for (int i = 0, temp; i < n; i++) {
    cin >> temp;
    a.push_back(temp);
  }
  int ans = rec(0, 0);
  cout << ans << endl;
  return 0;
}
