#include #include using namespace std; using namespace atcoder; using ll = long long; using ld = long double; int n, x, ans; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> x; if (x % 2 == 0) ans++; else ans--; } cout << abs(ans) << endl; return 0; }