#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const long long int mod_ = 998244353;
const int INF = 1000000000;
const long long int INF64 = (long long int)1E18;
int n;
int arr[101], dp[101][3];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  dp[1][0] = 1;
  dp[1][1] = !(arr[1] == 1 || arr[1] == 3);
  dp[1][2] = !(arr[1] == 2 || arr[1] == 3);
  for (int day = 2; day <= n; day++) {
    dp[day][0] = 1 + min(dp[day - 1][0], min(dp[day - 1][1], dp[day - 1][2]));
    dp[day][1] = 1 + min(dp[day - 1][0], min(dp[day - 1][1], dp[day - 1][2]));
    dp[day][2] = 1 + min(dp[day - 1][0], min(dp[day - 1][1], dp[day - 1][2]));
    if (arr[day] == 1 || arr[day] == 3)
      dp[day][1] = min(dp[day - 1][0], dp[day - 1][2]);
    if (arr[day] == 2 || arr[day] == 3)
      dp[day][2] = min(dp[day - 1][0], dp[day - 1][1]);
  }
  cout << min(dp[n][0], min(dp[n][1], dp[n][2]));
  return 0;
}
