• + 0 comments
    int main() {
        int odd = 0, even = 0;
        int n; cin >> n; int a[n];
        for(int i = 0; i < n; i++) { 
            cin >> a[i];
            if(a[i]%2 == 0) even++;
            else odd++;
        }
        if(n == 1 & odd == 1) { cout << -1; return 0; }
        cout << min(odd%2, odd%2 + even%2);
        return 0;
    }