#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, sum = 0, count = 0, m, flag = 0;
  cin >> n;
  vector<long long int> v, c;
  for (int i = 0; i < n; i++) {
    long long int in;
    cin >> in;
    c.push_back(in);
  }
  for (int i = 0; i < n; i++) {
    if (c[i] == 0)
      sum++;
    else if (c[i] == c[i - 1] && c[i - 1] < 3 && i != 0) {
      c[i] = 0;
      sum++;
    }
    if (c[i] == 3 && i != 0) c[i] = 3 - c[i - 1];
  }
  cout << sum;
  return 0;
}
