#include <bits/stdc++.h>
using namespace std;
int n;
int a[107];
int dp[107][4];
const int MAX = 0x3f3f3f3f;
int main() {
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
    for (int i = 1; i <= 3; ++i) dp[0][i] = 0;
    for (int i = 1; i <= n; ++i) {
      dp[i][3] = min(dp[i - 1][1], min(dp[i - 1][2], dp[i - 1][3])) + 1;
      if (a[i] == 0) {
        dp[i][1] = MAX;
        dp[i][2] = MAX;
      } else if (a[i] == 1) {
        dp[i][1] = min(dp[i - 1][2], dp[i - 1][3]);
        dp[i][2] = MAX;
      } else if (a[i] == 2) {
        dp[i][1] = MAX;
        dp[i][2] = min(dp[i - 1][1], dp[i - 1][3]);
      } else {
        dp[i][1] = min(dp[i - 1][2], dp[i - 1][3]);
        dp[i][2] = min(dp[i - 1][1], dp[i - 1][3]);
      }
    }
    printf("%d\n", min(dp[n][1], min(dp[n][2], dp[n][3])));
  }
}
