#include <bits/stdc++.h>
using namespace std;
long long int absv(long long int a) {
  if (a < 0) a *= -1;
  return a;
}
string num2str[10] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
long long Fib[] = {
    0,         1,         1,         2,          3,         5,
    8,         13,        21,        34,         55,        89,
    144,       233,       377,       610,        987,       1597,
    2584,      4181,      6765,      10946,      17711,     28657,
    46368,     75025,     121393,    196418,     317811,    514229,
    832040,    1346269,   2178309,   3524578,    5702887,   9227465,
    14930352,  24157817,  39088169,  63245986,   102334155, 165580141,
    267914296, 433494437, 701408733, 1134903170, 1836311903};
bool sortbysecdesc(const pair<long long int, long long int> &a,
                   const pair<long long int, long long int> &b) {
  return a.second > b.second;
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long C(long long int n, long long int r, long long int MOD) {
  vector<vector<long long>> C(2, vector<long long>(r + 1, 0));
  for (long long int i = 0; i <= n; i++) {
    for (long long int k = 0; k <= r && k <= i; k++)
      if (k == 0 || k == i)
        C[i & 1][k] = 1;
      else
        C[i & 1][k] = (C[(i - 1) & 1][k - 1] + C[(i - 1) & 1][k]) % MOD;
  }
  return C[n & 1][r];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, q = 0, ans = 0, ans2 = 0, T;
  T = 1;
  while (T--) {
    int n;
    cin >> n;
    int arr[n];
    for (long long i = 0; i < n; i++) cin >> arr[i];
    int dp[n][3];
    for (long long i = 0; i < n; i++) {
      dp[i][0] = dp[i][1] = dp[i][2] = 0;
    }
    dp[0][0] = 0;
    if (arr[0] == 1) dp[0][1] = 1;
    if (arr[0] == 2) dp[0][2] = 1;
    if (arr[0] == 3) {
      dp[0][1] = 1;
      dp[0][2] = 1;
    }
    for (int i = 1; i < n; i++) {
      dp[i][0] = max(dp[i - 1][0], max(dp[i - 1][1], dp[i - 1][2]));
      if (arr[i] == 1 || arr[i] == 3)
        dp[i][1] = max(1 + dp[i - 1][0], 1 + dp[i - 1][2]);
      if (arr[i] == 2 || arr[i] == 3)
        dp[i][2] = max(1 + dp[i - 1][0], 1 + dp[i - 1][1]);
    }
    cout << (n - max(dp[n - 1][0], max(dp[n - 1][1], dp[n - 1][2])));
  }
  return 0;
}
