#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  long long int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  long long int ans[n + 1][3];
  ans[0][0] = ans[0][2] = ans[0][1] = 0;
  for (int i = 0; i < n; i++) {
    ans[i + 1][0] = max(ans[i][1], ans[i][2]);
    ans[i + 1][1] =
        max(ans[i][0], ans[i][2]) + ((arr[i] == 1 || arr[i] == 3) ? 1 : 0);
    ans[i + 1][2] =
        max(ans[i][0], ans[i][1]) + ((arr[i] == 2 || arr[i] == 3) ? 1 : 0);
  }
  cout << n - max({ans[n][0], ans[n][1], ans[n][2]}) << "\n";
}
