#include <bits/stdc++.h>
using namespace std;
long long powmod(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
const int N = 111;
int dp[N][3];
int main() {
  int n, x;
  scanf("%d", &n);
  for (int i = 1; i < n + 1; i++) {
    scanf("%d", &x);
    for (int j = 0; j < 3; j++) {
      dp[i][j] = 0x3f3f3f3f;
      dp[i][0] = min(dp[i][0], dp[i - 1][j] + 1);
    }
    if (x & 1) {
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    }
    if (x & 2) {
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    }
  }
  int ans = 0x3f3f3f3f;
  for (int i = 0; i < 3; i++) ans = min(ans, dp[n][i]);
  printf("%d\n", ans);
  return 0;
}
