#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
const int N = 1e6 + 7;
int main() {
  int n, x, y, ans = 0;
  scanf("%d", &n);
  for (long long i = 0; i < (int)n; i++) {
    y = x;
    scanf("%d", &x);
    if (y == x && x != 3)
      x = 0;
    else if (y != x && x == 3)
      x -= y;
    if (x == 0) ans++;
  }
  cout << ans;
  return 0;
}
