#include <bits/stdc++.h>
using namespace std;
void IO() {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  IO();
  int n;
  cin >> n;
  vector<int> roger(n);
  for (int loop = 0; loop < n; loop++) {
    cin >> roger[loop];
  }
  vector<int> dp1(n, 0);
  int ans = 0;
  for (int i = 0; i < (int)roger.size(); i++) {
    if (roger[i] == 0) {
      ans++;
      dp1[i] = 0;
    } else if (roger[i] == 1) {
      if (i >= 1) {
        if (dp1[i - 1] == 1) {
          ans++;
          dp1[i] = 0;
        } else {
          dp1[i] = 1;
        }
      } else {
        dp1[i] = 1;
      }
    } else if (roger[i] == 2) {
      if (i >= 1) {
        if (dp1[i - 1] == 2) {
          ans++;
          dp1[i] = 0;
        } else {
          dp1[i] = 2;
        }
      } else {
        dp1[i] = 2;
      }
    } else {
      if (i >= 1) {
        if (dp1[i - 1] == 2) {
          dp1[i] = 1;
        } else if (dp1[i - 1] == 1) {
          dp1[i] = 2;
        } else {
          if (i != (int)roger.size() - 1 && roger[i + 1] == 1)
            dp1[i] = 2;
          else if (i != (int)roger.size() - 1 && roger[i + 1] == 2)
            dp1[i] = 1;
          else {
            if (dp1[i - 1] == 2) {
              dp1[i] = 1;
            } else if (dp1[i - 1] == 1) {
              dp1[i] = 2;
            } else {
              dp1[i] = 1;
              int counter = 0;
              for (int loop = i; loop < (int)roger.size(); loop++) {
                if (roger[loop] != 3) {
                  if (roger[loop] == 2) {
                    if (counter % 2 == 1)
                      dp1[i] = 1;
                    else
                      dp1[i] = 2;
                    break;
                  } else if (roger[loop] == 1) {
                    if (counter % 2 == 1)
                      dp1[i] = 2;
                    else
                      dp1[i] = 1;
                    break;
                  } else {
                    dp1[i] = 1;
                    break;
                  }
                } else
                  counter++;
              }
            }
          }
        }
      } else {
        if (roger[i + 1] == 2)
          dp1[i] = 1;
        else if (roger[i + 1] == 1)
          dp1[i] = 2;
        else {
          dp1[i] = 1;
          int counter = 0;
          for (int loop = i; loop < (int)roger.size(); loop++) {
            if (roger[loop] != 3) {
              if (roger[loop] == 2) {
                if (counter % 2 == 1)
                  dp1[i] = 1;
                else
                  dp1[i] = 2;
                break;
              } else if (roger[loop] == 1) {
                if (counter % 2 == 1)
                  dp1[i] = 2;
                else
                  dp1[i] = 1;
                break;
              } else {
                dp1[i] = 1;
                break;
              }
            } else
              counter++;
          }
        }
      }
    }
  }
  cout << ans << '\n';
}
