#include <bits/stdc++.h>
using namespace std;
int dp[101][3];
int max(int a, int b, int c) {
  a = max(a, b);
  return max(a, c);
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    dp[i][0] = max(dp[i - 1][0], dp[i - 1][1], dp[i - 1][2]);
    if (a == 1 || a == 3) dp[i][1] = max(dp[i - 1][0], dp[i - 1][2]) + 1;
    if (a == 2 || a == 3) dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]) + 1;
  }
  cout << (n - max(dp[n][0], dp[n][1], dp[n][2]));
  return 0;
}
