func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = int(3e5) + 12, mod = int(1e9) + 7;   int dp[120][120][120][3];   int n, p[N], x, y;   int main() {     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> p[i];     }     for (int i = 0; i <= n; i++) {       for (int j = 0; j <= n; j++) {         for (int k = 0; k <= n; k++) {           dp[i][j][k][0] = dp[i][j][k][1] = mod;         }       }     }     if (p[1] == 0) {       dp[1][1][0][1] = dp[1][0][1][0] = 0;     } else {       if (p[1] & 1) {         dp[1][1][0][1] = 0;       } else         dp[1][0][1][0] = 0;     }     for (int i = 2; i <= n; i++) {       for (int j = 0; j <= i; j++) {         int k = i - j;         if (p[i] & 1) {           if (j > 0)             dp[i][j][k][1] = min(dp[i][j][k][1], min(dp[i - 1][j - 1][k][0] + 1,                                                      dp[i - 1][j - 1][k][1]));         } else {           if (p[i] == 0) {             if (j > 0)               dp[i][j][k][1] = min(dp[i][j][k][1], min(dp[i - 1][j - 1][k][0] + 1,                                                        dp[i - 1][j - 1][k][1]));             if (k > 0)               dp[i][j][k][0] = min(dp[i][j][k][0], min(dp[i - 1][j][k - 1][1] + 1,                                                        dp[i - 1][j][k - 1][0]));           } else {             if (k > 0)               dp[i][j][k][0] = min(dp[i][j][k][0], min(dp[i - 1][j][k - 1][1] + 1,                                                        dp[i - 1][j][k - 1][0]));           }         }       }     }     x = (n + 1) / 2;     y = n - x;     cout << min(dp[n][x][y][0], dp[n][x][y][1]);     return 0;   }   