#include <bits/stdc++.h>
using namespace std;
const int inf = 109;
int num[inf];
long long dp[inf][3];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &num[i]);
  for (int i = 1; i <= n; ++i) {
    dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + 1;
    if (num[i] == 1 || num[i] == 3)
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    else
      dp[i][1] = 99999999;
    if (num[i] == 2 || num[i] == 3)
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    else
      dp[i][2] = 99999999;
  }
  printf("%lld\n", min(dp[n][0], min(dp[n][1], dp[n][2])));
}
