#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
const int N = 2e5 + 100;
int main() {
  int i, j;
  int n;
  cin >> n;
  int a[110];
  int dp[110][3];
  for (i = 0; i < n; ++i) cin >> a[i];
  dp[0][0] = 0;
  dp[0][1] = a[0] == 1 || a[0] == 3 ? 1 : -1;
  dp[0][2] = a[0] == 2 || a[0] == 3 ? 1 : -1;
  for (i = 1; i < n; ++i) {
    dp[i][0] = max(dp[i - 1][0], max(dp[i - 1][1], dp[i - 1][2]));
    dp[i][1] =
        a[i] == 1 || a[i] == 3 ? max(dp[i - 1][0], dp[i - 1][2]) + 1 : -1;
    dp[i][2] =
        a[i] == 2 || a[i] == 3 ? max(dp[i - 1][0], dp[i - 1][1]) + 1 : -1;
  }
  cout << n - max(dp[n - 1][0], max(dp[n - 1][1], dp[n - 1][2])) << endl;
  return 0;
}
