#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  int prev(0), ans(0), j, k;
  for (int i = 0; i < n; i++) {
    if (arr[i] == 0) {
      prev = 0;
      ans++;
    } else if (arr[i] == 1) {
      if (prev == 1) {
        ans++;
        prev = 0;
      } else
        prev = 1;
    } else if (arr[i] == 2) {
      if (prev == 2) {
        ans++;
        prev = 0;
      } else
        prev = 2;
    } else {
      if (prev == 1)
        prev = 2;
      else if (prev == 2)
        prev = 1;
      else {
        if (i == n - 1) continue;
        if (arr[i + 1] == 1)
          prev = 2;
        else if (arr[i + 1] == 2)
          prev = 1;
        else
          prev = 0;
      }
    }
  }
  cout << ans;
  return 0;
}
