#include<bits/stdc++.h>
using namespace std;
#define loi long long
//Failing at -> 1 0 0 13 0 0 16 0 0 4 0 0 7 0 19 0 0 10 0 0
pair<loi, loi> dp[100][100][100];
// min, parity
pair<loi, loi> garland(loi ar[], loi n, loi evecnt, loi oddcnt, loi idx)
{
// cout << "idx = : " << idx << " evecnt : " << evecnt << " oddcnt : " << oddcnt << "\n";
if(dp[idx][evecnt][oddcnt].first != INT_MAX)
return dp[idx][evecnt][oddcnt];
if(ar[idx] != 0)
{
if(idx == n - 1)
{
return (dp[idx][evecnt][oddcnt] = make_pair(0, ar[idx] & 1));
}
else
{
pair<loi, loi> p1 = garland(ar, n, evecnt, oddcnt, idx + 1);
dp[idx][evecnt][oddcnt].first = p1.first + (((ar[idx] & 1) == p1.second) ? 0 : 1);
dp[idx][evecnt][oddcnt].second = ar[idx] & 1;
return dp[idx][evecnt][oddcnt];
}
}
else
{
if(idx == n - 1)
{
if(evecnt > 0)
return(dp[idx][evecnt][oddcnt] = make_pair(0, 0));
else if(oddcnt > 0)
return(dp[idx][evecnt][oddcnt] = make_pair(0, 1));
}
else
{
if(evecnt > 0)
{
pair<loi, loi> p2 = garland(ar, n, evecnt - 1, oddcnt, idx + 1);
dp[idx][evecnt][oddcnt] = make_pair((p2.first + ((p2.second == 0) ? 0 : 1)), 0);
}
if(oddcnt > 0)
{
pair<loi, loi> p3 = garland(ar, n, evecnt, oddcnt - 1, idx + 1);
p3.first += ((p3.second == 1) ? 0 : 1);
p3.second = 1;
if(dp[idx][evecnt][oddcnt].first > p3.first)
dp[idx][evecnt][oddcnt] = p3;
}
return dp[idx][evecnt][oddcnt];
}
}
}
int main()
{
loi n;
cin >> n;
loi ar[n], freq[n + 1];
memset(freq, 0, sizeof(freq));
for(loi i = 0; i < n; i++)
{
cin >> ar[i];
if(ar[i])
freq[ar[i]]++;
}
loi evecnt = 0, oddcnt = 0;
for(loi i = 1; i <= n; i++)
{
if(!freq[i]){
if(i & 1)
oddcnt++;
else evecnt++;}
}
//cout << "Even count hai : " << evecnt << " Odd count hai : " << oddcnt << "\n";
for(loi i = 0; i < 100; i++)
for(loi j = 0; j < 100; j++)
for(loi k = 0; k < 100; k++)
dp[i][j][k] = make_pair(INT_MAX, 5);
loi ans = (garland(ar, n, evecnt, oddcnt, 0)).first;
/*cout << "DP array bani hai -> \n";
for(loi i = 0; i < 100; i++)
for(loi j = 0; j < 100; j++)
for(loi k = 0; k < 100; k++)
if(dp[i][j][k].first != INT_MAX)
cout << "idx : " << i << " evecnt : " << evecnt << " oddcnt : " << oddcnt << " " << dp[i][j][k].first << "\n";
*/
cout << ans << "\n";
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBsb2kgbG9uZyBsb25nCgovL0ZhaWxpbmcgYXQgLT4gMSAwIDAgMTMgMCAwIDE2IDAgMCA0IDAgMCA3IDAgMTkgMCAwIDEwIDAgMAoKcGFpcjxsb2ksIGxvaT4gZHBbMTAwXVsxMDBdWzEwMF07Ci8vICAgIG1pbiwgcGFyaXR5CnBhaXI8bG9pLCBsb2k+IGdhcmxhbmQobG9pIGFyW10sIGxvaSBuLCBsb2kgZXZlY250LCBsb2kgb2RkY250LCBsb2kgaWR4KQp7CiAgLy8gIGNvdXQgPDwgImlkeCA9IDogIiA8PCBpZHggPDwgIiBldmVjbnQgOiAiIDw8IGV2ZWNudCA8PCAiIG9kZGNudCA6ICIgPDwgb2RkY250IDw8ICJcbiI7CgogICAgaWYoZHBbaWR4XVtldmVjbnRdW29kZGNudF0uZmlyc3QgIT0gSU5UX01BWCkKICAgICAgIHJldHVybiBkcFtpZHhdW2V2ZWNudF1bb2RkY250XTsKCiAgICBpZihhcltpZHhdICE9IDApCiAgICB7CiAgICAgICAgaWYoaWR4ID09IG4gLSAxKQogICAgICAgIHsKICAgICAgICAgICAgcmV0dXJuIChkcFtpZHhdW2V2ZWNudF1bb2RkY250XSA9IG1ha2VfcGFpcigwLCBhcltpZHhdICYgMSkpOwogICAgICAgIH0KCiAgICAgICAgZWxzZQogICAgICAgIHsKICAgICAgICAgICAgcGFpcjxsb2ksIGxvaT4gcDEgPSBnYXJsYW5kKGFyLCBuLCBldmVjbnQsIG9kZGNudCwgaWR4ICsgMSk7CiAgICAgICAgICAgIGRwW2lkeF1bZXZlY250XVtvZGRjbnRdLmZpcnN0ID0gcDEuZmlyc3QgKyAoKChhcltpZHhdICYgMSkgPT0gcDEuc2Vjb25kKSA/IDAgOiAxKTsKICAgICAgICAgICAgZHBbaWR4XVtldmVjbnRdW29kZGNudF0uc2Vjb25kID0gYXJbaWR4XSAmIDE7CgogICAgICAgICAgICByZXR1cm4gZHBbaWR4XVtldmVjbnRdW29kZGNudF07CiAgICAgICAgfQogICAgfQoKICAgIGVsc2UKICAgIHsKICAgICAgIGlmKGlkeCA9PSBuIC0gMSkKICAgICAgIHsKICAgICAgICAgICBpZihldmVjbnQgPiAwKQogICAgICAgICAgICAgIHJldHVybihkcFtpZHhdW2V2ZWNudF1bb2RkY250XSA9IG1ha2VfcGFpcigwLCAwKSk7CgogICAgICAgICAgIGVsc2UgaWYob2RkY250ID4gMCkKICAgICAgICAgICAgICByZXR1cm4oZHBbaWR4XVtldmVjbnRdW29kZGNudF0gPSBtYWtlX3BhaXIoMCwgMSkpOwogICAgICAgfQoKICAgICAgIGVsc2UKICAgICAgIHsKICAgICAgICAgICBpZihldmVjbnQgPiAwKQogICAgICAgICAgIHsKICAgICAgICAgICAgICAgcGFpcjxsb2ksIGxvaT4gcDIgPSBnYXJsYW5kKGFyLCBuLCBldmVjbnQgLSAxLCBvZGRjbnQsIGlkeCArIDEpOwogICAgICAgICAgICAgICBkcFtpZHhdW2V2ZWNudF1bb2RkY250XSA9IG1ha2VfcGFpcigocDIuZmlyc3QgKyAoKHAyLnNlY29uZCA9PSAwKSA/IDAgOiAxKSksIDApOwogICAgICAgICAgIH0KCiAgICAgICAgICAgaWYob2RkY250ID4gMCkKICAgICAgICAgICB7CiAgICAgICAgICAgICAgIHBhaXI8bG9pLCBsb2k+IHAzID0gZ2FybGFuZChhciwgbiwgZXZlY250LCBvZGRjbnQgLSAxLCBpZHggKyAxKTsKICAgICAgICAgICAgICAgcDMuZmlyc3QgKz0gKChwMy5zZWNvbmQgPT0gMSkgPyAwIDogMSk7CiAgICAgICAgICAgICAgIHAzLnNlY29uZCA9IDE7CgogICAgICAgICAgICAgICBpZihkcFtpZHhdW2V2ZWNudF1bb2RkY250XS5maXJzdCA+IHAzLmZpcnN0KQogICAgICAgICAgICAgICAgICBkcFtpZHhdW2V2ZWNudF1bb2RkY250XSA9IHAzOwogICAgICAgICAgIH0KCiAgICAgICAgICAgcmV0dXJuIGRwW2lkeF1bZXZlY250XVtvZGRjbnRdOwogICAgICAgfQogICAgfQp9CgppbnQgbWFpbigpCnsKICAgIGxvaSBuOwoKICAgIGNpbiA+PiBuOwoKICAgIGxvaSBhcltuXSwgZnJlcVtuICsgMV07CgogICAgbWVtc2V0KGZyZXEsIDAsIHNpemVvZihmcmVxKSk7CgogICAgZm9yKGxvaSBpID0gMDsgaSA8IG47IGkrKykKICAgIHsKICAgICAgICBjaW4gPj4gYXJbaV07CgogICAgICAgIGlmKGFyW2ldKQogICAgICAgICAgICBmcmVxW2FyW2ldXSsrOwogICAgfQoKICAgIGxvaSBldmVjbnQgPSAwLCBvZGRjbnQgPSAwOwoKICAgIGZvcihsb2kgaSA9IDE7IGkgPD0gbjsgaSsrKQogICAgewogICAgICAgIGlmKCFmcmVxW2ldKXsKICAgICAgICAgICAgaWYoaSAmIDEpCiAgICAgICAgICAgICAgb2RkY250Kys7CgogICAgICAgICAgICBlbHNlIGV2ZWNudCsrO30KICAgIH0KCiAgICAvL2NvdXQgPDwgIkV2ZW4gY291bnQgaGFpIDogIiA8PCBldmVjbnQgPDwgIiAgT2RkIGNvdW50IGhhaSA6ICIgPDwgb2RkY250IDw8ICJcbiI7CgogICAgZm9yKGxvaSBpID0gMDsgaSA8IDEwMDsgaSsrKQog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