#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; i++) int main() { cin.tie(nullptr); int N; cin >> N; int even = 0, odd = 0; rep(i, 0, N) { int X; cin >> X; if (X % 2 == 0) even++; else odd++; } cout << abs(even - odd) << '\n'; }