#include <bits/stdc++.h>
using namespace std;
bool compatible(int state, int prevState) {
  if (state == 0)
    return false;
  else if (state == 1) {
    if (prevState == 2 || prevState == 0)
      return true;
    else
      return false;
  } else if (state == 2) {
    if (prevState == 0 || prevState == 1)
      return true;
    else
      return false;
  } else
    return true;
}
int minRest(int index, int prevState, int A[], int n, int **dp) {
  if (index > n) return 0;
  if (dp[index][prevState] != 1000000007) return dp[index][prevState];
  if (compatible(A[index], prevState)) {
    dp[index][prevState] =
        min(1 + minRest(index + 1, 0, A, n, dp), dp[index][prevState]);
    if (A[index] == 1)
      dp[index][prevState] =
          min(dp[index][prevState], minRest(index + 1, 1, A, n, dp));
    else if (A[index] == 2)
      dp[index][prevState] =
          min(dp[index][prevState], minRest(index + 1, 2, A, n, dp));
    else if (A[index] == 3) {
      if (prevState == 0)
        dp[index][prevState] =
            min(dp[index][prevState], min(minRest(index + 1, 1, A, n, dp),
                                          minRest(index + 1, 2, A, n, dp)));
      else if (prevState == 1)
        dp[index][prevState] =
            min(dp[index][prevState], minRest(index + 1, 2, A, n, dp));
      else
        dp[index][prevState] =
            min(dp[index][prevState], minRest(index + 1, 1, A, n, dp));
    }
    return dp[index][prevState];
  } else {
    dp[index][prevState] = 1 + minRest(index + 1, 0, A, n, dp);
  }
  return dp[index][prevState];
}
int main() {
  int n;
  cin >> n;
  int A[n];
  for (int(i) = 0; (i) < (n); (i)++) {
    cin >> A[i];
  }
  int **dp;
  dp = new int *[n + 1];
  for (int(i) = 0; (i) < (n + 1); (i)++) {
    dp[i] = new int[3];
  }
  for (int(i) = 0; (i) < (n + 1); (i)++) {
    for (int(j) = 0; (j) < (3); (j)++) {
      dp[i][j] = 1000000007;
    }
  }
  for (int(i) = 0; (i) < (3); (i)++) {
    dp[n][i] = 0;
  }
  cout << minRest(0, 0, A, n, dp) << endl;
  return 0;
}
