#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int dp[n + 1][3];
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < 3; j++) {
      dp[i][j] = 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      dp[i][0] = max({dp[i - 1][0], dp[i - 1][1], dp[i - 1][2]});
    }
    if (a[i] == 1 || a[i] == 3) {
      dp[i][0] = max({dp[i - 1][0], dp[i - 1][1], dp[i - 1][2]});
      dp[i][1] = max(dp[i - 1][0] + 1, dp[i - 1][2] + 1);
    }
    if (a[i] == 2 || a[i] == 3) {
      dp[i][0] = max({dp[i - 1][0], dp[i - 1][1], dp[i - 1][2]});
      dp[i][2] = max(dp[i - 1][0] + 1, dp[i - 1][1] + 1);
    }
  }
  int ans = n - max({dp[n][0], dp[n][1], dp[n][2]});
  cout << ans << endl;
}
