#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 10;
int dp[maxn][4], a[maxn];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, rest = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[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 (a[i] == 1 or a[i] == 3)
      dp[i][1] = min(dp[i - 1][2], dp[i - 1][0]);
    else
      dp[i][1] = INT_MAX;
    if (a[i] == 2 or a[i] == 3)
      dp[i][2] = min(dp[i - 1][1], dp[i - 1][0]);
    else
      dp[i][2] = INT_MAX;
  }
  cout << min(min(dp[n][1], dp[n][2]), dp[n][0]) << endl;
  return 0;
}
