#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e2 + 10;
int dp[MAXN][3], n, a;
int main() {
  cin >> n;
  for (int 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])));
}
