func_code_string: #include <bits/stdc++.h>   using namespace std;   const double eps = 1e-9;   const long long MOD = 998244353;   const long long N = (long long)1e4 + 9;   const long long inf = 1 << 30;   template <class T>   T gcd(T a, T b) {     return (b != 0 ? gcd<T>(b, a % b) : a);   }   template <class T>   T lcm(T a, T b) {     return (a / gcd<T>(a, b) * b);   }   template <typename T>   T exp(T b, T p) {     T x = 1;     while (p) {       if (p & 1) x = (x * b);       b = (b * b);       p = p >> 1;     }     return x;   }   inline long long ones(long long n) {     long long res = 0;     while (n && ++res) n -= n & (-n);     return res;   }   inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }   long long mem[109][3];   long long n, arr[109];   long long go(long long idx, long long last) {     if (idx == n) return 0;     long long &ret = mem[idx][last];     if (ret != -1) return ret;     ret = -inf;     if (arr[idx] == 0) ret = go(idx + 1, 0);     if (arr[idx] == 3) {       if (last != 1) ret = max(ret, 1 + go(idx + 1, 1));       if (last != 2) ret = max(ret, 1 + go(idx + 1, 2));     }     if (arr[idx] == 1) {       if (last != 1)         ret = 1 + go(idx + 1, 1);       else         ret = go(idx + 1, 0);     }     if (arr[idx] == 2) {       if (last != 2)         ret = 1 + go(idx + 1, 2);       else         ret = go(idx + 1, 0);     }     return ret;   }   int32_t main() {     ios::sync_with_stdio(0);     cin.tie(nullptr);     cout.tie(0);     cin >> n;     for (long long i = 0; i < n; ++i) {       cin >> arr[i];     }     memset(mem, -1, sizeof(mem));     long long ans = go(0, 0);     cout << n - ans;   }   