#include <bits/stdc++.h>
using namespace std;
int wait;
const double pi =
    3.14159265358979323846264338327950288419716939937510582097494459;
const double EPS = 1e-12;
const int meminf = 0x3f;
const int MAXN = 1e5 + 10;
const long long MOD = 1e9 + 7;
const long long Mod = 1e9 + 7;
const long long mod = 1e9 + 7;
const long long modd = 998244353;
const int MAX = 1e7 + 5;
const int oo = 2e9 + 10;
const long long OO = 1e18 + 10;
const int N = 1e5 + 5;
const int logN = (int)(log2(N));
int dx[] = {0, 1, 0, -1, -1, -1, 1, 1};
int dy[] = {1, 0, -1, 0, -1, 1, -1, 1};
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long lcm(long long a, long long b) { return ((a * b) / gcd(a, b)); }
int dp[105][5];
int arr[105];
int n;
int solve(int idx, int prev) {
  if (idx == n) return 0;
  int& ret = dp[idx][prev];
  if (~ret) return ret;
  int ans = solve(idx + 1, 0) + 1;
  if ((arr[idx] == 1 || arr[idx] == 3) && prev != 1)
    ans = min(ans, solve(idx + 1, 1));
  if ((arr[idx] == 2 || arr[idx] == 3) && prev != 2)
    ans = min(ans, solve(idx + 1, 2));
  return ret = ans;
}
int main() {
  memset(dp, -1, sizeof dp);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int ans = solve(0, 0);
  cout << ans << endl;
}
