#include <bits/stdc++.h>
using namespace std;
char s[300000];
long long dp[105][5], n, a[105];
int main() {
  scanf("%I64d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  for (int i = 0; i <= n; i++)
    for (int j = 0; j < 3; j++) dp[i][j] = 0x7fffffffll;
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + 1;
    }
    if (a[i] == 1) {
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
      dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + 1;
    }
    if (a[i] == 2) {
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
      dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + 1;
    }
    if (a[i] == 3) {
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
      dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + 1;
    }
  }
  printf("%I64d\n", min(min(dp[n][0], dp[n][1]), dp[n][2]));
  return 0;
}
