#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) #define all(c) (c).begin(), (c).end() #define zero(a) memset(a, 0, sizeof a) #define minus(a) memset(a, -1, sizeof a) #define minimize(a, x) a = std::min(a, x) #define maximize(a, x) a = std::max(a, x) typedef long long ll; int const inf = 1<<29; int main() { int N; cin >> N; vector X(N); rep(i, N) { cin >> X[i]; } sort(all(X)); vector erased(N); int ans = N; bool update = 1; while(update) { update = 0; rep(i, X.size()-1) { if((X[i+1] - X[i]) % 2 == 0) { X[i+1] = X[i] + 2; } else { X[i+1] = X[i] + 1; } } REP(i, 1, X.size()) { if(!erased[i-1] && (X[i]-X[i-1]) % 2) { erased[i] = erased[i-1] = 1; ans -= 2; update = 1; } } rep(i, X.size()) { if(erased[i]) { X.erase(X.begin() + i); erased.erase(erased.begin() + i); i--; } } } // rep(i, N) { cout << (erased[i] ? "---" : to_string(X[i])) << " ";}cout << endl; cout << ans << endl; return 0; }