#include <bits/stdc++.h>
using namespace std;
int md = 1000000007;
int gcd(int a, int b, int& x, int& y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  int x1, y1;
  int d = gcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
bool find_any_solution(int a, int b, int c, int& x0, int& y0, int& g) {
  g = gcd(abs(a), abs(b), x0, y0);
  if (c % g != 0) return false;
  x0 *= c / g;
  y0 *= c / g;
  if (a < 0) x0 *= -1;
  if (b < 0) y0 *= -1;
  return true;
}
const int mod = 998244353;
int binpow(long long a, long long b) {
  long long res = 1;
  while (b > 0)
    if (b & 1) {
      res = (res * a) % mod;
      --b;
    } else {
      a = (a * a) % mod;
      b >>= 1;
    }
  return res % mod;
}
vector<vector<int>> d;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(10);
  cout.setf(ios::fixed);
  int n;
  cin >> n;
  vector<int> v(n + 1);
  for (int i = 1; i <= n; i++) cin >> v[i];
  d.resize(n + 1, vector<int>(3, 1e9 + 5));
  d[0][0] = 0;
  d[0][1] = 0;
  d[0][2] = 0;
  for (int i = 1; i <= n; i++) {
    d[i][0] = min(d[i][0], min(d[i - 1][0], min(d[i - 1][1], d[i - 1][2]))) + 1;
    if (v[i] == 1 || v[i] == 3)
      d[i][1] = min(d[i][1], min(d[i - 1][0], d[i - 1][2]));
    if (v[i] == 2 || v[i] == 3)
      d[i][2] = min(d[i][2], min(d[i - 1][0], d[i - 1][1]));
  }
  cout << min(d[n][0], min(d[n][1], d[n][2]));
  return 0;
}
