#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int n, a[110];
int f[110][3];
void upd(int &u, int x, int y, int z = inf) {
  x = min(x, inf);
  y = min(y, inf);
  z = min(z, inf);
  u = min(x, min(y, z));
}
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    for (int i = 1; i <= 100; i++) {
      f[i][0] = a[i] / 2 ? 0 : inf;
      f[i][1] = a[i] % 2 ? 0 : inf;
      f[i][2] = 1;
      upd(f[i][0], f[i - 1][1] + f[i][0], f[i - 1][2] + f[i][0]);
      upd(f[i][1], f[i - 1][0] + f[i][1], f[i - 1][2] + f[i][1]);
      upd(f[i][2], f[i - 1][1] + f[i][2], f[i - 1][2] + f[i][2],
          f[i][2] + f[i - 1][0]);
    }
    printf("%d\n", min(f[n][0], min(f[n][1], f[n][2])));
  }
}
