let inputs = ``; process.stdin.on('data', function (chunk) { inputs += chunk; }); process.stdin.on('end', function () { let input = inputs.split("\n"); let input2 = input[1].split(" "); input[0] = parseInt(input[0]); for(let i = 0; i < input[0]; i++){ input2[i] = parseInt(input2[i]); } for(let value of input2){ value = parseInt(value); } let even = 0; let odd = 0; for(let i = 0; i < input[0]; i++){ if(input2[i] % 2 == 0){ even++; }else{ odd++; } } let ans = () => { if(even > odd){ return even - odd; }else{ return odd - even; } }; console.log(ans()); });