#include <bits/stdc++.h>
using namespace std;
void io() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
const int N = 2e5 + 9;
const long long MOD = 1e9 + 7;
const int INF = 1e9;
int dx[5] = {0, -1, 1, 0, 0};
int dy[5] = {0, 0, 0, -1, 1};
char dc[5] = {'0', 'U', 'D', 'L', 'R'};
int dp[N][9], a[N];
int main() {
  int test;
  test = 1;
  while (test--) {
    int n;
    cin >> n;
    for (int i = (1), _n = (n); i <= _n; ++i) {
      cin >> a[i];
      dp[i][0] = dp[i][1] = dp[i][2] = INF;
    }
    for (int i = (1), _n = (n); i <= _n; ++i) {
      dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
      if (a[i] == 1 || a[i] == 3) dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
      if (a[i] == 2 || a[i] == 3) dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    }
    cout << min(dp[n][0], min(dp[n][1], dp[n][2]));
  }
  return 0;
}
