#include <bits/stdc++.h>
#include <algorithm>
#include <queue>
using namespace std;
int main() {
	int N; 
	cin >> N; 
	set<int> A; 
	for(int i = 0; i < N; i++){
		int a; 
		cin >> a; 
		A.insert(a); 
	}
	int L = A.size(); 
	if(L % 2 == 1){cout << L << endl;}
	else{cout << L - 1 << endl;}
}