#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e5 + 10;
int n;
int dp[110][3], a[110];
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  dp[0][0] = 1;
  dp[0][1] = 0;
  dp[0][2] = 0;
  for (int i = 0; i < n; i++) {
    dp[i][0] = dp[i][1] = dp[i][2] = 1e9;
    if (a[i] == 0) {
      dp[i][0] = 1 + min({dp[i - 1][0], dp[i - 1][1], dp[i - 1][2]});
    } else if (a[i] == 1) {
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
      dp[i][0] = 1 + min({dp[i - 1][0], dp[i - 1][2], dp[i - 1][1]});
    } else if (a[i] == 2) {
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
      dp[i][0] = 1 + min({dp[i - 1][0], dp[i - 1][2], dp[i - 1][1]});
    } else {
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    }
  }
  int ans = min({dp[n - 1][0], dp[n - 1][2], dp[n - 1][1]});
  cout << (ans == (int)1e9 ? 0 : ans);
}
