#include <bits/stdc++.h>
using namespace std;
int main() {
  int y = 0, a[100005], n, l;
  scanf("%d", &n);
  scanf("%d", &l);
  a[0] = l;
  if (a[0] != 0) y++;
  for (int i = 1; i < n; i++) {
    scanf("%d", &a[i]);
    if ((a[i] != 0 && a[i] != a[i - 1]) || a[i] == 3) {
      y++;
      if (a[i] == 3 && a[i - 1] == 2) a[i] = 1;
      if (a[i] == 3 && a[i - 1] == 1) a[i] = 2;
    } else
      a[i] = 0;
  }
  printf("%d", n - y);
  return 0;
}
