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