#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; int odd = 0,even = 0; while(N--){ int a; cin >> a; if(a%2) odd++; else even++; } cout << max(odd,even)-min(odd,even) << endl; }