#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
using namespace std;

int main(){
	int n,a;
	set<int> s;
	vector<int> v;

	cin >> n;
	for(int i = 0;i < n;i++){
		cin >> a;
		s.insert(a);
		v.push_back(a);
	}
	
	int len = v.size() - s.size();
	if(len%2) cout << v.size()-len-1;
	else cout << v.size()-len;
}