#include <algorithm>
#include <array>
#include <iostream>
using namespace std;
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int n; if (!(cin >> n)) return 0;
    const int inf = 1000000;
    array<int, 3> dp{0, inf, inf};
    for (int i = 0, a; i < n; ++i) {
        cin >> a;
        array<int, 3> next{1 + min({dp[0], dp[1], dp[2]}), inf, inf};
        if (a & 1) next[1] = min(dp[0], dp[2]);
        if (a & 2) next[2] = min(dp[0], dp[1]);
        dp = next;
    }
    cout << min({dp[0], dp[1], dp[2]}) << '\n';
}
