#include <bits/stdc++.h>
using namespace std;
int tmin(int a, int b, int c) { return min(a, min(b, c)); }
int n;
int vals[105];
int dp[105][3];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> vals[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 3; j++) {
      dp[i][j] = 2000000000;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (vals[i - 1] == 1) {
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    } else if (vals[i - 1] == 2) {
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    } else if (vals[i - 1] == 3) {
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    }
    dp[i][0] = 1 + tmin(dp[i - 1][0], dp[i - 1][1], dp[i - 1][2]);
  }
  cout << tmin(dp[n][0], dp[n][1], dp[n][2]) << '\n';
  return 0;
}
