#include <bits/stdc++.h>
using namespace std;
int n;
const int N = 1004;
const int INF = 1000000009;
int dp[N][4];
int a[N];
int td(int idx, int pre) {
  if (idx == n) {
    return 0;
  }
  if (dp[idx][pre] != INF) {
    return dp[idx][pre];
  }
  int ans = INF;
  ans = min(ans, td(idx + 1, 1) + 1);
  if (a[idx] == 1 && pre != 2) {
    ans = min(ans, td(idx + 1, 2));
  }
  if (a[idx] == 2 && pre != 3) {
    ans = min(ans, td(idx + 1, 3));
  }
  if (a[idx] == 3 && pre != 3) {
    ans = min(ans, td(idx + 1, 3));
  }
  if (a[idx] == 3 && pre != 2) {
    ans = min(ans, td(idx + 1, 2));
  }
  return dp[idx][pre] = ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    dp[i][0] = INF;
    dp[i][1] = INF;
    dp[i][2] = INF;
    dp[i][3] = INF;
  }
  cout << td(0, 0) << endl;
  return 0;
}
