#include <bits/stdc++.h>
using namespace std;
int N;
int val[101];
int dp[101][4];
int main() {
  ios_base::sync_with_stdio(false);
  if (fopen("cf699c.in", "r")) {
    freopen("cf699c.in", "r", stdin);
    freopen("cf699c.out", "w", stdout);
  }
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> val[i];
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 4; j++) {
      dp[i][j] = 1000000000;
    }
  }
  if (val[0] == 0) {
    dp[0][0] = 1;
  } else if (val[0] == 1) {
    dp[0][0] = 1;
    dp[0][1] = 0;
  } else if (val[0] == 2) {
    dp[0][0] = 1;
    dp[0][2] = 0;
  } else {
    dp[0][0] = 1;
    dp[0][1] = 0;
    dp[0][2] = 0;
  }
  for (int i = 1; i < N; i++) {
    dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
    if (val[i] == 1 || val[i] == 3) {
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    }
    if (val[i] == 2 || val[i] == 3) {
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    }
  }
  cout << min(dp[N - 1][0], min(dp[N - 1][1], dp[N - 1][2]));
}
