#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios::sync_with_stdio(NULL);
  cout.tie(NULL);
  cin.tie(NULL);
}
const double pi = 2 * acos(0.0);
const long long oo = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int nn = 1e2 + 15;
int dx[8] = {1, 0, 0, -1, 1, -1, 1, -1};
int dy[8] = {0, 1, -1, 0, -1, 1, 1, -1};
long long n, arr[nn];
long long mem[nn][nn];
long long solve(int idx, int last) {
  if (idx == n) return 0;
  long long &ret = mem[idx][last];
  if (ret != -1) return ret;
  if (arr[idx] == 3) {
    if (last == 1)
      return ret = min(1 + solve(idx + 1, 0), solve(idx + 1, 2));
    else if (last == 2)
      return ret = min(solve(idx + 1, 1), 1 + solve(idx + 1, 0));
    else
      return ret = min(solve(idx + 1, 1), solve(idx + 1, 2));
  } else if (arr[idx] == 1) {
    if (last == 1)
      return ret = solve(idx + 1, 0) + 1;
    else
      return ret = solve(idx + 1, 1);
  } else if (arr[idx] == 2) {
    if (last == 2)
      return ret = solve(idx + 1, 0) + 1;
    else
      return ret = solve(idx + 1, 2);
  } else if (arr[idx] == 0)
    return ret = 1 + solve(idx + 1, 0);
}
void intial() {
  fill(arr, arr + nn, 4);
  memset(mem, -1, sizeof(mem));
}
int main() {
  fast();
  intial();
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  cout << solve(0, 3) << "\n";
  return 0;
}
