#include <bits/stdc++.h>
using namespace std;
long long mod = 1e7 + 7;
template <typename... T>
void read(T &...args) {
  ((cin >> args), ...);
}
template <typename T, typename T0>
void read(pair<T, T0> &p) {
  cin >> p.first >> p.second;
}
template <typename T>
void read(vector<T> &oneD) {
  for (long long i = 0; i < oneD.size(); i++) {
    read(oneD[i]);
  }
}
template <typename T>
void read(T oneD[], int n) {
  for (long long i = 0; i < n; i++) {
    read(oneD[i]);
  }
}
template <typename... T>
void write(T... args) {
  ((cout << args << " "), ...);
  cout << "\n";
}
template <typename T, typename T0>
void write(pair<T, T0> &p) {
  write(p.first);
  write(p.second);
  cout << "\n";
}
template <typename T>
void write(vector<T> &oneD) {
  for (long long i = 0; i < oneD.size(); i++) {
    cout << oneD[i] << " ";
  }
  cout << "\n";
}
template <typename T, typename T0>
void write(vector<pair<T, T0> > &oneD) {
  for (long long i = 0; i < oneD.size(); i++) {
    write(oneD[i].first, oneD[i].second);
  }
}
template <typename T>
void write(T oneD[], int n) {
  for (long long i = 0; i < n; i++) {
    cout << oneD[i] << " ";
  }
  cout << "\n";
}
template <typename T, typename T0>
void write(map<T, T0> &mpp) {
  for (auto it : mpp) {
    write(it.first);
    cout << ": ";
    write(it.second);
    cout << "\n";
  }
  cout << "\n";
}
long long qpow(long long n, long long m) {
  long long ret = 1;
  while (m) {
    if (m & 1) ret = ret * n % mod;
    n = n * n % mod;
    m >>= 1;
  }
  return ret;
}
long long inv(long long a) { return qpow(a, mod - 2); }
long long min(long long a, long long b) { return a > b ? b : a; }
int main() {
  long long n;
  cin >> n;
  long long arr[n];
  read(arr, n);
  long long dp[n][3];
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < 3; j++) dp[i][j] = 1e9;
  dp[0][0] = 1;
  if (arr[0] == 1) {
    dp[0][2] = 0;
  }
  if (arr[0] == 2) {
    dp[0][1] = 0;
  }
  if (arr[0] == 3) {
    dp[0][1] = 0;
    dp[0][2] = 0;
  }
  for (long long i = 1; i < n; i++) {
    dp[i][0] = 1 + min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2]));
    if (arr[i] == 2 || arr[i] == 3) dp[i][1] = min(dp[i - 1][0], dp[i - 1][2]);
    if (arr[i] == 1 || arr[i] == 3) dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]);
  }
  cout << min(dp[n - 1][0], min(dp[n - 1][1], dp[n - 1][2]));
}
