#include <bits/stdc++.h>
using namespace std;
long long n, a[110], dp[110][3];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j < 3; ++j) dp[i][j] = 0x7fffffff;
  dp[1][0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int past = 0; past <= 2; ++past) {
      for (int now = 0; now <= 2; ++now) {
        if ((a[i] & 2) == 0 && now == 1) continue;
        if ((a[i] & 1) == 0 && now == 2) continue;
        if (now > 0 && now == past) continue;
        dp[i][now] = min(dp[i][now], dp[i - 1][past] + (now == 0));
      }
    }
  }
  cout << min(min(dp[n][0], dp[n][1]), dp[n][2]) << endl;
}
