#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long arr[n];
  for (long long i = 0; i < (n); i++) cin >> arr[i];
  long long dp[n][3];
  memset(dp, 1000000007, sizeof dp);
  dp[0][0] = 1;
  dp[0][1] = 1 - (arr[0] == 1 || arr[0] == 3);
  dp[0][2] = 1 - (arr[0] == 2 || arr[0] == 3);
  for (long long i = 1; i < n; i++) {
    dp[i][0] = 1 + min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2]));
    if (arr[i] == 1 || arr[i] == 3) dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    if (arr[i] == 2 || arr[i] == 3) dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
  }
  cout << min(dp[n - 1][0], min(dp[n - 1][1], dp[n - 1][2])) << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) solve();
  return 0;
}
