#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline string get() {
  char ch[1000010];
  scanf("%s", ch);
  return ch;
}
const int MAX_LG = 60;
const long long maxn = 1000 + 100;
const long long base = 29;
const long long mod = 1e9 + 7;
const long long INF = 1e18 + 100;
long long dp[maxn][4];
long long a[maxn];
bool mark[maxn][4];
long long n;
inline long long calc(long long pos, long long pre) {
  if (pos == n) return 0;
  if (mark[pos][pre]) {
    return dp[pos][pre];
  }
  mark[pos][pre] = true;
  if (a[pos] == 0) {
    dp[pos][pre] = 1 + calc(pos + 1, 0);
  } else if (a[pos] == 1) {
    if (pre == 1)
      dp[pos][pre] = 1 + calc(pos + 1, 0);
    else
      dp[pos][pre] = min(1 + calc(pos + 1, 0), calc(pos + 1, 1));
  } else if (a[pos] == 2) {
    if (pre == 2)
      dp[pos][pre] = 1 + calc(pos + 1, 0);
    else
      dp[pos][pre] = min(1 + calc(pos + 1, 0), calc(pos + 1, 2));
  } else {
    if (pre == 0) {
      dp[pos][pre] =
          min(min(calc(pos + 1, 0) + 1, calc(pos + 1, 1)), calc(pos + 1, 2));
    } else if (pre == 1) {
      dp[pos][pre] = min(calc(pos + 1, 0) + 1, calc(pos + 1, 2));
    } else if (pre == 2) {
      dp[pos][pre] = min(calc(pos + 1, 0) + 1, calc(pos + 1, 1));
    }
  }
  return dp[pos][pre];
}
int32_t main() {
  n = in();
  for (long long i = 0; i < n; i++) a[i] = in();
  cout << calc(0, 0) << "\n";
}
