#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, a[N], dp[N][2][2];
int solve(int day, bool gym, bool contest) {
  if (day == n) return 0;
  if (dp[day][gym][contest] != -1) return dp[day][gym][contest];
  int op1 = 1000000000, op2 = 1000000000, op3 = 1000000000;
  op1 = 1 + solve(day + 1, 0, 0);
  if (gym == 0 && a[day] > 1) op2 = solve(day + 1, 1, 0);
  if (contest == 0 && a[day] % 2) op3 = solve(day + 1, 0, 1);
  dp[day][gym][contest] = min(op1, min(op2, op3));
  return dp[day][gym][contest];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  memset(dp, -1, sizeof dp);
  cout << solve(0, 0, 0);
}
