#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int a[100 + 5], dp[100 + 5][100 + 5];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  memset(dp, 100, sizeof(dp));
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    dp[i][0] = min(dp[i - 1][1], min(dp[i - 1][2], dp[i - 1][0])) + 1;
    if (a[i] == 2 || a[i] == 3) dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    if (a[i] == 1 || a[i] == 3) dp[i][2] = min(dp[i - 1][1], dp[i - 1][0]);
  }
  cout << min(min(dp[n][1], dp[n][2]), dp[n][0]) << endl;
}
