#include <bits/stdc++.h>
using namespace std;
int a[105], dp[105][3], n;
int solve(int i, int t) {
  int minimum;
  if (i == n) return 0;
  if (t == 0 && a[i] < 2) return 1000000000;
  if (t == 1 && a[i] % 2 == 0) return 1000000000;
  if (dp[i][t] != -1) return dp[i][t];
  if (t == 0) {
    return dp[i][t] = min(solve(i + 1, 1), solve(i + 1, 2));
  } else if (t == 1) {
    return dp[i][t] = min(solve(i + 1, 0), solve(i + 1, 2));
  } else {
    minimum = min(solve(i + 1, 0), solve(i + 1, 2));
    return dp[i][t] = 1 + min(minimum, solve(i + 1, 1));
  }
}
int main() {
  int i, j, k;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) {
    for (j = 0; j <= 2; j++) {
      dp[i][j] = -1;
    }
  }
  k = min(solve(0, 0), solve(0, 1));
  cout << min(k, solve(0, 2));
}
