#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 10;
int n, a, dp[maxn], ans;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (i) {
      if (a == 3 && dp[i - 1] != 3)
        dp[i] = abs(a - dp[i - 1]);
      else if (a == 3 && dp[i - 1] == 3)
        dp[i] = 3;
      else if (a == dp[i - 1] && (a))
        dp[i] = 0;
      else
        dp[i] = a;
    } else
      dp[i] = a;
    if (!(dp[i])) ans++;
  }
  cout << ans << "\n";
}
