#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1e18 + 7;
const unsigned long long BASE = 29;
const int N = 1e2 + 7;
const int P = 1e3 + 7;
const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const double Pi = acos(-1.);
const double EPS = 1e-10;
long long kpow(long long a, long long b) {
  long long ret = 1;
  for (; b; b >>= 1, a = a * a % MOD)
    if (b & 1) ret = ret * a % MOD;
  return ret;
}
int n, a[N], f[N][3];
int main() {
  scanf("%d", &n);
  for (int i = 1; i < (n + 1); ++i) scanf("%d", &a[i]);
  memset(f, -1, sizeof(f));
  for (int i = 0; i < (3); ++i) f[0][i] = 0;
  for (int i = 1; i < (n + 1); ++i) {
    int x = -1;
    for (int j = 0; j < (3); ++j)
      if (~f[i - 1][j])
        if (x == -1 || x > f[i - 1][j] + 1) x = f[i - 1][j] + 1;
    f[i][0] = x;
    if (a[i] & 1) {
      x = -1;
      for (int j = 0; j < (3); ++j)
        if (j != 1 && ~f[i - 1][j])
          if (x == -1 || x > f[i - 1][j]) x = f[i - 1][j];
      f[i][1] = x;
    }
    if (a[i] & 2) {
      x = -1;
      for (int j = 0; j < (3); ++j)
        if (j != 2 && ~f[i - 1][j])
          if (x == -1 || x > f[i - 1][j]) x = f[i - 1][j];
      f[i][2] = x;
    }
  }
  int ans = -1;
  for (int i = 0; i < (3); ++i)
    if (~f[n][i])
      if (ans == -1 || ans > f[n][i]) ans = f[n][i];
  printf("%d", ans);
  return 0;
}
