// Quiz 2 Nomor A - Bezaleel Steven Jadimadapot Sihotang
#include <iostream>
using namespace std;
int main() {
unsigned int n;
cin >> n;
unsigned int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
bool gym_is_opened; bool IT_contest_is_carried_out;
unsigned int rest = 0;
if (a[0] == 0) {
gym_is_opened = false;
IT_contest_is_carried_out = false;
rest++;
}
if (a[0] == 1) {
gym_is_opened = false;
IT_contest_is_carried_out = true;
}
if (a[0] == 2) {
gym_is_opened = true;
IT_contest_is_carried_out = false;
}
if (a[0] == 3) {
gym_is_opened = true;
IT_contest_is_carried_out = true;
}
if (a[1] == 1) {
gym_is_opened = false;
IT_contest_is_carried_out = true;
if (a[1] == a[0]) {
if (IT_contest_is_carried_out) {
IT_contest_is_carried_out = false;
}
}
}
if (a[1] == 2) {
gym_is_opened = true;
IT_contest_is_carried_out = false;
if (a[1] == a[0]) {
if (gym_is_opened) {
gym_is_opened = false;
}
}
}
if (a[1] == 3) {
gym_is_opened = true;
IT_contest_is_carried_out = true;
if (a[1] == a[0]) {
if (gym_is_opened) {
gym_is_opened = false;
}
if (IT_contest_is_carried_out) {
IT_contest_is_carried_out = false;
}
}
}
if (not IT_contest_is_carried_out && not gym_is_opened) {
rest++;
}
if (a[1] == 0) {
gym_is_opened = false;
IT_contest_is_carried_out = false;
rest++;
}
for (int i = 2; i < n; i++) {
if (a[i] == 0) {
gym_is_opened = false;
IT_contest_is_carried_out = false;
rest++;
continue;
}
if (a[i] == 1) {
gym_is_opened = false;
IT_contest_is_carried_out = true;
if (a[i] == a[i - 1] || a[i] == a[i - 2]) {
if (gym_is_opened) {
gym_is_opened = false;
}
if (IT_contest_is_carried_out) {
IT_contest_is_carried_out = false;
}
}
}
if (a[i] == 2) {
gym_is_opened = true;
IT_contest_is_carried_out = false;
if (a[i] == a[i - 1] || a[i] == a[i - 2]) {
if (gym_is_opened) {
gym_is_opened = false;
}
if (IT_contest_is_carried_out) {
IT_contest_is_carried_out = false;
}
}
}
if (a[i] == 3) {
gym_is_opened = true;
IT_contest_is_carried_out = true;
if (a[i] == a[i - 1] || a[i] == a[i - 2]) {
if (gym_is_opened) {
gym_is_opened = false;
}
if (IT_contest_is_carried_out) {
IT_contest_is_carried_out = false;
}
}
}
if (not IT_contest_is_carried_out && not gym_is_opened) {
rest++;
}
}
cout << rest;
}