#include <bits/stdc++.h>
using namespace std;
long long f[102][4], res, a[102], n;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  res = 1e9;
  memset(f, 100, sizeof(f));
  f[0][0] = 0;
  for (int i = 0; i <= n; i++)
    for (int trc = 0; trc <= 2; trc++)
      if (i + 1 <= n)
        if (trc == 0) {
          if (a[i + 1] == 0) f[i + 1][0] = min(f[i + 1][0], f[i][trc] + 1);
          if (a[i + 1] == 1) f[i + 1][2] = min(f[i + 1][2], f[i][trc]);
          if (a[i + 1] == 2) f[i + 1][1] = min(f[i + 1][1], f[i][trc]);
          if (a[i + 1] == 3) {
            f[i + 1][1] = min(f[i + 1][1], f[i][trc]);
            f[i + 1][2] = min(f[i + 1][2], f[i][trc]);
          }
        } else if (trc == 1) {
          if (a[i + 1] == 0) f[i + 1][0] = min(f[i + 1][0], f[i][trc] + 1);
          if (a[i + 1] == 1) f[i + 1][2] = min(f[i + 1][2], f[i][trc]);
          if (a[i + 1] == 2) f[i + 1][0] = min(f[i + 1][0], f[i][trc] + 1);
          if (a[i + 1] == 3) f[i + 1][2] = min(f[i + 1][2], f[i][trc]);
        } else {
          if (a[i + 1] == 0) f[i + 1][0] = min(f[i + 1][0], f[i][trc] + 1);
          if (a[i + 1] == 1) f[i + 1][0] = min(f[i + 1][0], f[i][trc] + 1);
          if (a[i + 1] == 2) f[i + 1][1] = min(f[i + 1][1], f[i][trc]);
          if (a[i + 1] == 3) f[i + 1][1] = min(f[i + 1][1], f[i][trc]);
        }
  for (int j = 0; j <= 3; j++) res = min(res, f[n][j]);
  cout << res;
}
