#include using namespace std; int main() { int N; cin >> N; int g = 0, k = 0; int tmp; for( int i = 0; i < N; i++ ) { cin >> tmp; if( tmp%2 == 0 ) { g++; } else { k++; } } cout << (abs(g-k)) << endl; return 0; }