#include <bits/stdc++.h>
using namespace std;
int Set(int n, int pos) { return (n = n | 1 << pos); }
int reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
long long pow(long long a, long long b, long long mod) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y);
      if (x > mod) x %= mod;
    }
    y = (y * y);
    if (y > mod) y %= mod;
    b /= 2;
  }
  return x;
}
long long modInverse(long long a, long long m) { return pow(a, m - 2, m); }
int arr[10001];
int dp[10001][10];
int n;
int fun(int idx, int last) {
  if (idx == n) {
    return 0;
  }
  int ans = INT_MAX;
  if (dp[idx][last] != -1) return dp[idx][last];
  if (last == 1) {
    if (arr[idx] == 2 || arr[idx] == 1) {
      ans = min(ans, 1 + fun(idx + 1, 0));
    } else if (arr[idx] == 3) {
      ans = min(ans, fun(idx + 1, 2));
    } else {
      ans = min(ans, fun(idx + 1, 2));
    }
  } else if (last == 2) {
    if (arr[idx] == 3 || arr[idx] == 1) {
      ans = min(ans, 1 + fun(idx + 1, 0));
    } else if (arr[idx] == 2) {
      ans = min(ans, fun(idx + 1, 1));
    } else {
      ans = min(ans, fun(idx + 1, 1));
    }
  } else {
    if (arr[idx] == 1) {
      ans = min(ans, 1 + fun(idx + 1, 0));
    } else if (arr[idx] == 2) {
      ans = min(ans, fun(idx + 1, 1));
    } else if (arr[idx] == 3) {
      ans = min(ans, fun(idx + 1, 2));
    } else {
      ans = min(ans, min(fun(idx + 1, 1), fun(idx + 1, 2)));
    }
  }
  return dp[idx][last] = ans;
}
int main() {
  while (cin >> n) {
    memset(dp, -1, sizeof dp);
    for (int i = 0; i < n; i++) cin >> arr[i], arr[i]++;
    int ans = fun(0, 0);
    cout << ans << endl;
  }
}
