func_code_string: #include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   #pragma GCC target( avx,avx2,fma )   using namespace std;   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int n;     cin >> n;     int arr[n + 1];     int dp[n + 1][3];     for (int i = 1; i <= n; i++) cin >> arr[i];     dp[0][0] = dp[0][1] = dp[0][2] = 0;     for (int i = 1; i <= n; i++) {       dp[i][0] = max(max(dp[i - 1][1], dp[i - 1][2]), dp[i - 1][0]);       if (arr[i] == 0) {         dp[i][1] = dp[i - 1][1];         dp[i][2] = dp[i - 1][2];       }       if (arr[i] == 1) {         dp[i][1] = max(dp[i - 1][0] + 1, dp[i - 1][2] + 1);         dp[i][2] = max(dp[i - 1][2], dp[i - 1][0]);       }       if (arr[i] == 2) {         dp[i][2] = max(dp[i - 1][0] + 1, dp[i - 1][1] + 1);         dp[i][1] = max(dp[i - 1][1], dp[i - 1][0]);       }       if (arr[i] == 3) {         dp[i][1] = max(dp[i - 1][0] + 1, dp[i - 1][2] + 1);         dp[i][2] = max(dp[i - 1][0] + 1, dp[i - 1][1] + 1);       }     }     cout << n - max(dp[n][0], max(dp[n][1], dp[n][2]));     return 0;   }   