#include <bits/stdc++.h>
using namespace std;
int n, a[101], dp[101], ans;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == 0) {
      dp[i] = 0;
      ans++;
    } else if (a[i] == 3) {
      if (dp[i - 1] == 0 || dp[i - 1] == 3)
        dp[i] = 3;
      else if (dp[i - 1] == 1)
        dp[i] = 2;
      else if (dp[i - 1] == 2)
        dp[i] = 1;
    } else if (a[i] == 1) {
      if (dp[i - 1] == 1) {
        dp[i] = 0;
        ans++;
      } else if (dp[i - 1] == 0 || dp[i - 1] == 3 || dp[i - 1] == 2)
        dp[i] = 1;
    } else if (a[i] == 2) {
      if (dp[i - 1] == 2) {
        dp[i] = 0;
        ans++;
      } else if (dp[i - 1] == 0 || dp[i - 1] == 3 || dp[i - 1] == 1)
        dp[i] = 2;
    }
  }
  cout << ans << endl;
  return 0;
}
