#include <bits/stdc++.h>
int arr[101];
int N;
int min = 999999999;
int memo[101][3];
int findMin(int idx, int prev) {
  int min_Rest = 999999999;
  if (idx == N + 1) return 0;
  if (memo[idx][prev] != -1) return memo[idx][prev];
  if (prev != 1 && (arr[idx] == 1 || arr[idx] == 3))
    min_Rest = ((min_Rest) < (findMin(idx + 1, 1)) ? (min_Rest)
                                                   : (findMin(idx + 1, 1)));
  if (prev != 2 && (arr[idx] == 2 || arr[idx] == 3))
    min_Rest = ((min_Rest) < (findMin(idx + 1, 2)) ? (min_Rest)
                                                   : (findMin(idx + 1, 2)));
  min_Rest =
      ((min_Rest) < (1 + findMin(idx + 1, 0)) ? (min_Rest)
                                              : (1 + findMin(idx + 1, 0)));
  memo[idx][prev] = min_Rest;
  return min_Rest;
}
int main() {
  int T, TC;
  {
    int i, j;
    scanf("%d", &N);
    for (i = 1; i <= N; i++) scanf("%d", &arr[i]);
    min = 999999999;
    for (i = 0; i <= N; i++)
      for (j = 0; j < 3; j++) memo[i][j] = -1;
    printf("%d\n", findMin(1, 0));
  }
  return 0;
}
