#include <bits/stdc++.h>
using namespace std;
int day[110];
int dp[110][3];
int main() {
  int N;
  while (cin >> N) {
    int i, j;
    for (i = 1; i <= N; i++) {
      cin >> day[i];
      for (j = 0; j < 3; j++) {
        dp[i][j] = 0x1f1f1f1f;
      }
    }
    dp[0][0] = 0;
    dp[0][1] = 0;
    dp[0][2] = 0;
    for (i = 1; i <= N; i++) {
      if (day[i] == 0) {
        dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + 1;
      } else if (day[i] == 1) {
        dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + 1;
        dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
      } else if (day[i] == 2) {
        dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][2]), dp[i - 1][1]) + 1;
        dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
      } else {
        dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + 1;
        dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
        dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
      }
    }
    cout << min(min(dp[N][0], dp[N][1]), dp[N][2]) << endl;
  }
  return 0;
}
