#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    int dp[3][n];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    if (a[0] == 0) {
      dp[0][0] = 0;
      dp[1][0] = 0;
      dp[2][0] = 0;
    } else {
      if (a[0] == 3) {
        dp[0][0] = 0;
        dp[1][0] = 1;
        dp[2][0] = 1;
      }
      if (a[0] == 1) {
        dp[0][0] = 0;
        dp[1][0] = 1;
        dp[2][0] = 0;
      }
      if (a[0] == 2) {
        dp[0][0] = 0;
        dp[1][0] = 0;
        dp[2][0] = 1;
      }
    }
    for (int i = 1; i < n; i++) {
      if (a[i] == 0) {
        dp[0][i] = max(dp[0][i - 1], max(dp[1][i - 1], dp[2][i - 1]));
        dp[1][i] = dp[1][i - 1];
        dp[2][i] = dp[2][i - 1];
      } else {
        if (a[i] == 3) {
          dp[1][i] = max(dp[0][i - 1] + 1, dp[2][i - 1] + 1);
          dp[2][i] = max(dp[0][i - 1] + 1, dp[1][i - 1] + 1);
          dp[0][i] = max(dp[0][i - 1], max(dp[1][i - 1], dp[2][i - 1]));
          continue;
        }
        if (a[i] == 1) {
          dp[1][i] = max(dp[0][i - 1] + 1, dp[2][i - 1] + 1);
          dp[0][i] = max(dp[0][i - 1], max(dp[1][i - 1], dp[2][i - 1]));
          dp[2][i] = dp[2][i - 1];
          continue;
        }
        if (a[i] == 2) {
          dp[2][i] = max(dp[0][i - 1] + 1, dp[1][i - 1] + 1);
          dp[0][i] = max(dp[0][i - 1], max(dp[1][i - 1], dp[2][i - 1]));
          dp[1][i] = dp[1][i - 1];
        }
      }
    }
    cout << n - max(dp[0][n - 1], max(dp[1][n - 1], dp[2][n - 1])) << '\n';
  }
  return 0;
}
