#include <bits/stdc++.h>
using ::std::cin;
using ::std::cout;
using ::std::endl;
using ::std::min;
int main() {
  int n;
  cin >> n;
  int notContest = 0, notSport = 0;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    int oldNotContest = notContest, oldNotSport = notSport;
    notContest = min(1 + oldNotContest, oldNotSport + !(a & 2));
    notSport = min(1 + oldNotSport, oldNotContest + !(a & 1));
  }
  cout << min(notContest, notSport) << endl;
}
