#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
const long long int mymax = 1e18;
const long long int mymin = -1e18;
const double PIE = 3.1415926536;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int a[n], ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (!a[0]) {
    ans++;
  }
  for (int i = 1; i < n; i++) {
    if (!a[i]) {
      ans++;
    } else if (a[i] == 3) {
      if (a[i - 1] == 1) {
        a[i] = 2;
      } else if (a[i - 1] == 2) {
        a[i] = 1;
      }
    } else if (a[i] == a[i - 1]) {
      a[i] = 0;
      ans++;
    }
  }
  cout << ans;
  return 0;
}
