#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  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;
}
int n, v[1010], dp[1010][4];
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n + 1; i++) scanf("%d", v + i);
  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 (v[i] == 1 || v[i] == 3)
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    else
      dp[i][1] = 1 << 30;
    if (v[i] == 2 || v[i] == 3)
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    else
      dp[i][2] = 1 << 30;
  }
  printf("%d\n", min(dp[n][0], min(dp[n][1], dp[n][2])));
}
