#include <bits/stdc++.h>
using namespace std;
int arr[105];
long long dp[200][4];
int main() {
  int ans = 0;
  int n;
  scanf("%d", &n);
  for (int i = 0; i <= (n - 1); i++) scanf("%d", &arr[i]);
  for (int i = 0; i <= (n - 1); i++)
    for (int j = 0; j <= (3); j++) dp[i][j] = INT_MAX;
  dp[0][0] = 1;
  if (arr[0] & (1)) dp[0][1] = 0;
  if (arr[0] & 2) dp[0][2] = 0;
  for (int i = 1; i <= (n - 1); i++) {
    dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
    if (arr[i] & 1) dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    if (arr[i] & 2) 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])) << endl;
  return 0;
}
