#include <bits/stdc++.h>
using namespace std;
long long n, dp[100000], b[100000], ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  b[0] = 3;
  for (long long i = 1; i <= n; i++) {
    cin >> b[i];
  }
  for (long long i = 1; i <= n; i++) {
    if (b[i] == b[i - 1] && b[i] != 3) {
      b[i] = 0;
    } else if (b[i] == 3 && b[i - 1] != 3) {
      b[i] -= b[i - 1];
    }
    if (!b[i]) {
      ans++;
    }
  }
  cout << ans << '\n';
  return 0;
}
