func_code_string: #include <bits/stdc++.h>   using namespace std;   void solve() {     long long n;     cin >> n;     vector<long long int> a(n);     for (auto &it : a) cin >> it;     long long o = (n + 1) / 2, e = n / 2;     for (auto it : a) {       if (!it) continue;       if (it % 2)         o--;       else         e--;     }     long long l_val = -1, l_idx = -1;     vector<pair<long long int, long long int> > v11, v00, v10, v01;     for (long long i = 0; i < n; i++) {       long long it = a[i];       if (!it) continue;       if (it % 2) {         if (l_val == -1)           v11.push_back({i - l_idx - 1, 1});         else if (l_val % 2)           v11.push_back({i - l_idx - 1, 0});         else           v01.push_back({i - l_idx - 1, 0});       } else {         if (l_val == -1)           v00.push_back({i - l_idx - 1, 1});         else if (l_val % 2 == 0)           v00.push_back({i - l_idx - 1, 0});         else           v10.push_back({i - l_idx - 1, 0});       }       l_idx = i, l_val = it % 2;     }     if (l_val != -1) {       if (l_val % 2)         v11.push_back({n - l_idx - 1, 1});       else         v00.push_back({n - l_idx - 1, 1});     }     sort(v00.begin(), v00.end());     sort(v11.begin(), v11.end());     long long ans = ((long long int)(v01).size()) + ((long long int)(v10).size());     for (auto it : v11) {       if (it.second == 1) continue;       if (o >= it.first)         o -= it.first;       else         ans += 2;     }     for (auto it : v11) {       if (it.second == 0) continue;       if (o >= it.first)         o -= it.first;       else         ans++;     }     for (auto it : v00) {       if (it.second == 1) continue;       if (e >= it.first)         e -= it.first;       else         ans += 2;     }     for (auto it : v00) {       if (it.second == 0) continue;       if (e >= it.first)         e -= it.first;       else         ans++;     }     bool first = 0;     for (auto it : a) first |= it;     if (!first and n > 1) ans++;     cout << ans;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.precision(20);     long long t = 1;     while (t--) {       solve();       cout <<   n ;     }     cin.get();     return 0;   }   