#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 2e18;
const int N = 1231;
int n, m;
int dp[N][3];
int a[N];
int main() {
  cin >> n;
  int i, j;
  for (i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    dp[i][0] = dp[i][1] = dp[i][2] = n;
  }
  dp[0][1] = dp[0][2] = n;
  dp[0][0] = 0;
  for (i = 1; i <= n; ++i) {
    dp[i][0] = min(dp[i - 1][2], min(dp[i - 1][0], dp[i - 1][1])) + 1;
    if (a[i] == 1) {
      dp[i][2] = min(dp[i - 1][1], dp[i - 1][0]);
    }
    if (a[i] == 2) {
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    }
    if (a[i] == 3) {
      dp[i][2] = min(dp[i - 1][1], dp[i - 1][0]);
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    }
  }
  int ans = n;
  ans = min(ans, dp[n][0]);
  ans = min(ans, dp[n][1]);
  ans = min(ans, dp[n][2]);
  printf("%d\n", ans);
}
