#include <bits/stdc++.h>
using namespace std;
struct A {
  long long to;
  A* nxt;
} a[(20ll + (long long)2e5)];
long long na;
A* hd[(20ll + (long long)2e5)];
void ins(long long from, long long to) {
  a[na] = A{to, hd[from]};
  hd[from] = &a[na++];
}
long long s[(20ll + (long long)2e5)];
long long dp[(20ll + (long long)2e5)][3];
int main() {
  long long n;
  scanf("%lld", &(n));
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &(s[i]));
    dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
    dp[i][1] = (s[i] & 1) ? min(dp[i - 1][0], dp[i - 1][2]) : 1e17;
    dp[i][2] = (s[i] & 2) ? min(dp[i - 1][0], dp[i - 1][1]) : 1e17;
  }
  printf(
      "%lld"
      "\n",
      min(dp[n][0], min(dp[n][1], dp[n][2])));
  return 0;
}
