#include <bits/stdc++.h>
using namespace std;
long long exp(long long x, long long y) {
  x %= 1000000007;
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % 1000000007;
    x = x * x % 1000000007;
    y >>= 1;
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i <= n - 1; ++i) cin >> v[i];
  vector<vector<int> > dp(n + 1, vector<int>(3));
  for (int i = 1; i <= n; ++i) {
    dp[i][0] = max({dp[i - 1][0], dp[i - 1][1], dp[i - 1][2]});
    if (v[i - 1] == 1 || v[i - 1] == 3) {
      dp[i][1] = max(dp[i - 1][0] + 1, dp[i - 1][2] + 1);
    }
    if (v[i - 1] == 2 || v[i - 1] == 3) {
      dp[i][2] = max(dp[i - 1][0] + 1, dp[i - 1][1] + 1);
    }
  }
  cout << n - max({dp[n][0], dp[n][1], dp[n][2]});
  return 0;
}
