#include using namespace std; int ans = 0; int main() { int N; cin >> N; vector v(N); for (int i = 0; i < N; ++i) { cin >> v[i]; } sort(v.begin(), v.end()); int cnt = 0; for (int i = 0; i < N; ++i) { if (abs(v[i]) % 2) ++cnt; } cout << abs((N-cnt)-cnt) << endl; }