#include <bits/stdc++.h>
using namespace std;
int n;
int dp[107][4];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int tag;
    scanf("%d", &tag);
    switch (tag) {
      case 0: {
        dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
        dp[i][1] = dp[i][2] = (1 << 29);
        break;
      }
      case 1: {
        dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
        dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
        dp[i][2] = (1 << 29);
        break;
      }
      case 2: {
        dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
        dp[i][1] = (1 << 29);
        dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
        break;
      }
      case 3: {
        dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;
        dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
        dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
        break;
      }
    }
  }
  printf("%d\n", min(dp[n][0], min(dp[n][1], dp[n][2])));
  return 0;
}
