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