#include <bits/stdc++.h>
int main() {
  int n, p, t, cnt = 0;
  scanf("%d", &n);
  scanf("%d", &p);
  if (!p) cnt++;
  while (--n) {
    scanf("%d", &t);
    if (!t)
      cnt++;
    else if (t == 1) {
      if (p == 1) t = 0, cnt++;
    } else if (t == 2) {
      if (p == 2) t = 0, cnt++;
    } else if (t == 3) {
      if (p == 1)
        t = 2;
      else if (p == 2)
        t = 1;
    }
    p = t;
  }
  printf("%d\n", cnt);
}
