#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
long long int dp[105][3];
long long int a[105];
long long int cal(long long int day, long long int flag) {
  if (day < 0) return 0;
  if (dp[day][flag] != -1) return dp[day][flag];
  if (a[day] == 0) {
    if (flag > 0) return dp[day][flag] = mod;
    return dp[day][flag] =
               1 + min(min(cal(day - 1, 0), cal(day - 1, 1)), cal(day - 1, 2));
  }
  if (a[day] == 1) {
    if (flag == 0)
      return dp[day][flag] = 1 + min(min(cal(day - 1, 0), cal(day - 1, 1)),
                                     cal(day - 1, 2));
    else if (flag == 1)
      return dp[day][flag] = min(min(cal(day - 1, 0), mod), cal(day - 1, 2));
    else if (flag == 2)
      return dp[day][flag] = mod;
  }
  if (a[day] == 2) {
    if (flag == 0)
      return dp[day][flag] = 1 + min(min(cal(day - 1, 0), cal(day - 1, 1)),
                                     cal(day - 1, 2));
    else if (flag == 2)
      return dp[day][flag] = min(min(cal(day - 1, 0), mod), cal(day - 1, 1));
    else if (flag == 1)
      return dp[day][flag] = mod;
  } else {
    if (flag == 0)
      return dp[day][flag] = 1 + min(min(cal(day - 1, 0), cal(day - 1, 1)),
                                     cal(day - 1, 2));
    else if (flag == 1)
      return dp[day][flag] = min(min(cal(day - 1, 0), mod), cal(day - 1, 2));
    else if (flag == 2)
      return dp[day][flag] = min(min(cal(day - 1, 0), mod), cal(day - 1, 1));
  }
}
int main() {
  long long int n, i, j;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++)
    for (j = 0; j < 3; j++) dp[i][j] = -1;
  long long int val1 = cal(n - 1, 0);
  val1 = min(val1, cal(n - 1, 1));
  val1 = min(val1, cal(n - 1, 2));
  cout << val1 << endl;
  return 0;
}
