#include <bits/stdc++.h>
using namespace std;
bool cmp(int a, int b) { return (a > b); }
bool isprime(int x) {
  if (x == 2) {
    return true;
  }
  if (x == 1) {
    return false;
  }
  if (x % 2 == 0) {
    return false;
  }
  for (int i = 3; i * i <= x; i += 2) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}
int dp[106][4];
int a[1006];
int n;
int solve(int ind, int s) {
  int &ans = dp[ind][s];
  if (ans != -1) {
    return ans;
  }
  if (ind >= n) {
    return 0;
  }
  ans = 1e9;
  if (a[ind] == 0) {
    ans = 1 + solve(ind + 1, 0);
  }
  if (a[ind] == 1) {
    if (s != 2) {
      ans = min(ans, solve(ind + 1, 2));
    } else {
      ans = 1 + solve(ind + 1, 0);
    }
  }
  if (a[ind] == 2) {
    if (s != 1) {
      ans = min(ans, solve(ind + 1, 1));
    } else {
      ans = 1 + solve(ind + 1, 0);
    }
  }
  if (a[ind] == 3) {
    if (s != 1) {
      ans = min(ans, solve(ind + 1, 1));
    }
    if (s != 2) {
      ans = min(ans, solve(ind + 1, 2));
    }
  }
  return ans;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  memset(dp, -1, sizeof(dp));
  cout << solve(0, 0);
  return 0;
}
