#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long int n;
  cin >> n;
  vector<long long int> arr(n);
  ;
  for (long long int i = 0; i < arr.size(); i++) cin >> arr[i];
  ;
  vector<vector<long long int>> dp(n, vector<long long int>(3, 0));
  vector<vector<long long int>> rest(n, vector<long long int>(3, INT_MAX));
  dp[0][0] = 1;
  rest[0][0] = 1;
  if (arr[0] == 1)
    dp[0][1] = 1, rest[0][1] = 0;
  else if (arr[0] == 2)
    dp[0][2] = 1, rest[0][2] = 0;
  else if (arr[0] == 3) {
    dp[0][1] = 1;
    dp[0][2] = 1;
    rest[0][1] = 0, rest[0][2] = 0;
  }
  for (long long int i = 1; i < n; i++) {
    long long int mini = 1e3;
    for (long long int j = 0; j < 3; j++)
      if (dp[i - 1][j] == 1) mini = min(mini, rest[i - 1][j]);
    dp[i][0] = 1;
    rest[i][0] = mini + 1;
    if (arr[i] == 1) {
      mini = 1e3;
      if (dp[i - 1][2] == 1) mini = min(mini, rest[i - 1][2]);
      if (dp[i - 1][0] == 1) mini = min(mini, rest[i - 1][0]);
      dp[i][1] = 1;
      rest[i][1] = mini;
    }
    if (arr[i] == 2) {
      mini = 1e3;
      if (dp[i - 1][1] == 1) mini = min(mini, rest[i - 1][1]);
      if (dp[i - 1][0] == 1) mini = min(mini, rest[i - 1][0]);
      dp[i][2] = 1;
      rest[i][2] = mini;
    }
    if (arr[i] == 3) {
      mini = 1e3;
      if (dp[i - 1][2] == 1) mini = min(mini, rest[i - 1][2]);
      if (dp[i - 1][0] == 1) mini = min(mini, rest[i - 1][0]);
      dp[i][1] = 1;
      rest[i][1] = mini;
      mini = 1e3;
      if (dp[i - 1][1] == 1) mini = min(mini, rest[i - 1][1]);
      if (dp[i - 1][0] == 1) mini = min(mini, rest[i - 1][0]);
      dp[i][2] = 1;
      rest[i][2] = mini;
    }
  }
  long long int ans = 1e3;
  for (long long int i = 0; i < 3; i++) {
    if (dp[n - 1][i] == 1) ans = min(ans, rest[n - 1][i]);
  }
  cout << ans << endl;
  return 0;
}
