func_code_string: #include <bits/stdc++.h>   using namespace std;   void cline() { cout <<   n ; }   template <typename T, typename... V>   void cline(T t, V... v) {     cout << t;     if (sizeof...(v)) cout <<    ;     cline(v...);   }   void cspc() { cout <<    ; }   template <typename T, typename... V>   void cspc(T t, V... v) {     cout << t;     if (sizeof...(v)) cout <<    ;     cspc(v...);   }   int n;   int a[105];   int dp[104][52][52][2];   int calc(int indx, int even, int odd, int pre) {     if (indx == n) return 0;     if (dp[indx][even][odd][pre] != -1) return dp[indx][even][odd][pre];     if (indx == 0) {       if (a[indx] == 0) {         if (even == 0) {           return dp[indx][even][odd][pre] = calc(indx + 1, even, odd - 1, 1);         } else if (odd == 0) {           return dp[indx][even][odd][pre] = calc(indx + 1, even - 1, odd, 0);         } else {           return dp[indx][even][odd][pre] = min(calc(indx + 1, even, odd - 1, 1),                                                 calc(indx + 1, even - 1, odd, 0));         }       } else {         return dp[indx][even][odd][pre] = calc(indx + 1, even, odd, a[indx] % 2);       }     } else {       if (a[indx] == 0) {         if (even == 0) {           if (pre % 2 == 0) {             return dp[indx][even][odd][pre] =                        calc(indx + 1, even, odd - 1, 1) + 1;           } else {             return dp[indx][even][odd][pre] = calc(indx + 1, even, odd - 1, 1);           }         } else if (odd == 0) {           if (pre % 2 == 1) {             return dp[indx][even][odd][pre] =                        calc(indx + 1, even - 1, odd, 0) + 1;           } else {             return dp[indx][even][odd][pre] = calc(indx + 1, even - 1, odd, 0);           }         } else {           if (pre % 2 != 0) {             return dp[indx][even][odd][pre] =                        min(calc(indx + 1, even, odd - 1, 1),                            calc(indx + 1, even - 1, odd, 0) + 1);           } else {             return dp[indx][even][odd][pre] =                        min(calc(indx + 1, even, odd - 1, 1) + 1,                            calc(indx + 1, even - 1, odd, 0));           }         }       } else {         if (a[indx] % 2 != pre % 2) {           return dp[indx][even][odd][pre] =                      calc(indx + 1, even, odd, a[indx] % 2) + 1;         } else {           return dp[indx][even][odd][pre] =                      calc(indx + 1, even, odd, a[indx] % 2);         }       }     }   }   int32_t main() {     ios::sync_with_stdio(0);     cin.tie(0);     cin >> n;     int even = n / 2, odd = (n + 1) / 2;     for (int i = 0; i < n; i++) {       cin >> a[i];       if (a[i] % 2 == 0)         even--;       else         odd--;       if (a[i] == 0) even++;     }     for (int in1 = 0; in1 < 104; in1++) {       for (int in2 = 0; in2 < 52; in2++) {         for (int in3 = 0; in3 < 52; in3++) {           dp[in1][in2][in3][0] = -1;           dp[in1][in2][in3][1] = -1;         }       }     }     cspc(calc(0, even, odd, 0));     return 0;   }   