func_code_string: #include <bits/stdc++.h>   using namespace std;   void run() {     long long n;     cin >> n;     long long p[n];     for (long long i = 0; i < n; i++) cin >> p[i];     for (long long i = 0; i < n; i++) {       if (p[i] == 0) p[i] = -1;       if (p[i] != -1) p[i] %= 2;     }     long long ones = 0, zeros = 0;     for (long long i = 1; i <= n; i++) {       if (i % 2)         ones++;       else         zeros++;     }     for (long long i = 0; i < n; i++) {       if (p[i] == 0)         zeros--;       else if (p[i] == 1)         ones--;     }     long long dp[n][zeros + 1][ones + 1][2];     for (long long i = 0; i < n; i++) {       for (long long j = 0; j < zeros + 1; j++) {         for (long long k = 0; k < ones + 1; k++) {           for (long long l = 0; l < 2; l++) dp[i][j][k][l] = 1e9;         }       }     }     if (p[0] != -1)       dp[0][0][0][p[0]] = 0;     else {       dp[0][1][0][0] = 0;       dp[0][0][1][1] = 0;     }     for (long long i = 1; i < n; i++) {       for (long long j = 0; j < zeros + 1; j++) {         for (long long k = 0; k < ones + 1; k++) {           if (p[i] == -1) {             if (j + 1 <= zeros)               dp[i][j + 1][k][0] =                   min(dp[i - 1][j][k][0], dp[i - 1][j][k][1] + 1);             if (k + 1 <= ones)               dp[i][j][k + 1][1] =                   min(dp[i - 1][j][k][1], dp[i - 1][j][k][0] + 1);           } else             dp[i][j][k][p[i]] =                 min(dp[i - 1][j][k][p[i]], dp[i - 1][j][k][1 - p[i]] + 1);         }       }     }     cout << min(dp[n - 1][zeros][ones][0], dp[n - 1][zeros][ones][1]);   }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     ;     run();     return 0;   }   