#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    long long* a = new long long[n];
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
    }
    long long** d = new long long*[n];
    for (long long i = 0; i < n; i++) {
      d[i] = new long long[3];
    }
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < 3; j++) {
        d[i][j] = 0;
      }
    }
    if (a[0] == 1 || a[0] == 3) {
      d[0][1] = 1;
    }
    if (a[0] == 2 || a[0] == 3) {
      d[0][2] = 1;
    }
    for (long long i = 1; i < n; i++) {
      d[i][0] = max(d[i - 1][0], max(d[i - 1][1], d[i - 1][2]));
      if (a[i] == 1 || a[i] == 3) {
        d[i][1] = max(d[i - 1][2] + 1, d[i - 1][0] + 1);
      }
      if (a[i] == 2 || a[i] == 3) {
        d[i][2] = max(d[i - 1][1] + 1, d[i - 1][0] + 1);
      }
    }
    cout << n - max(d[n - 1][0], max(d[n - 1][1], d[n - 1][2]));
    delete[] a;
    for (long long i = 0; i < n; i++) {
      delete[] d[i];
    }
    delete[] d;
  }
  return 0;
}
