#include <bits/stdc++.h>
using namespace std;
int N;
int A[105];
void input() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
}
int dp[105][3];
int sovle() {
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 3; j++) {
      dp[i + 1][0] = max(dp[i + 1][0], dp[i][j]);
      if (j == 0) {
        if (A[i] & 1) {
          dp[i + 1][1] = max(dp[i + 1][1], dp[i][j] + 1);
        }
        if ((A[i] >> 1) & 1) {
          dp[i + 1][2] = max(dp[i + 1][2], dp[i][j] + 1);
        }
      } else {
        int nj = j == 1 ? 1 : 0;
        if ((A[i] >> nj) & 1) {
          dp[i + 1][nj + 1] = max(dp[i + 1][nj + 1], dp[i][j] + 1);
        }
      }
    }
  }
  int ret = 0;
  for (int i = 0; i < 3; i++) {
    ret = max(ret, dp[N][i]);
  }
  return N - ret;
}
int main() {
  input();
  cout << sovle() << endl;
  return 0;
}
