#include <bits/stdc++.h>
using namespace std;
int minn(int a, int b, int c) {
  a = min(a, b);
  a = min(a, c);
  return a;
}
int dp[105][4];
int main() {
  int n;
  scanf("%d", &n);
  int i;
  memset(dp, 0x3f3f3f3f, sizeof(dp));
  dp[0][0] = 0;
  for (i = 1; i <= n; i++) {
    int m;
    scanf("%d", &m);
    dp[i][0] = minn(dp[i - 1][0], dp[i - 1][1], dp[i - 1][2]) + 1;
    if (m == 1)
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    else if (m == 2)
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    else if (m == 3) {
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
    }
  }
  int k = minn(dp[n][0], dp[n][1], dp[n][2]);
  printf("%d\n", k);
  return 0;
}
