#include <bits/stdc++.h>
using namespace std;
int dp[105][3], a;
int main() {
  ios::sync_with_stdio(0);
  int n, i, j;
  dp[0][0] = 0;
  dp[0][1] = 0;
  dp[0][2] = 0;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a;
    dp[i][0] = max(dp[i - 1][0], max(dp[i - 1][1], dp[i - 1][2]));
    if (a == 1 || a == 3) dp[i][1] = max(dp[i - 1][0], dp[i - 1][2]) + 1;
    if (a == 2 || a == 3) dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]) + 1;
  }
  cout << n - max(dp[n][0], max(dp[n][1], dp[n][2]));
  return 0;
}
