#include<iostream>
#include<map>
using namespace std;
int main(){
	int n,m,count=0;
	map<int,int>mp;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>m;
		mp[m]++;
		if(mp[m]==3){
			mp[m]=1;
			count--;
		}
		if(mp[m]==2){
			count++;
		}
	}
	cout<<mp.size()-count%2<<endl;
	return 0;
}