#include <bits/stdc++.h>
using namespace std;
void solve() {
  vector<pair<int, int>> state(4);
  state[0] = make_pair(0, 0);
  state[1] = make_pair(0, 1);
  state[2] = make_pair(1, 0);
  state[3] = make_pair(1, 1);
  int n;
  cin >> n;
  vector<vector<int>> m(3, vector<int>(n));
  for (int i = 0; i < n; i++) {
    int val;
    cin >> val;
    m[1][i] = state[val].first;
    m[2][i] = state[val].second;
  }
  vector<vector<int>> dp(3, vector<int>(n));
  dp[1][0] = m[1][0] == 1;
  dp[2][0] = m[2][0] == 1;
  for (int i = 1; i < n; i++) {
    dp[0][i] = max(dp[1][i - 1], dp[2][i - 1]);
    dp[1][i] = (m[1][i] == 1) + max(dp[0][i - 1], dp[2][i - 1]);
    dp[2][i] = (m[2][i] == 1) + max(dp[0][i - 1], dp[1][i - 1]);
  }
  int maxVal = max(dp[1][n - 1], dp[2][n - 1]);
  cout << n - maxVal;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
