#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn=100005;
int n,ans,num,a[maxn];
char ch;
inline int get_num(){
	num=0;ch=getchar();
	while(ch<'0'||ch>'9'){ch=getchar();	}
	while(ch<='9'&&ch>='0'){num=(num<<3)+(num<<1)+ch-'0';ch=getchar();	}
	return num;
}
int main(){
	scanf("%d",&n);
	for(int i=0;i<n;i++)a[i]=get_num();
	sort(a,a+n);
	ans=0;
	int chong=0;
	for(int i=1;i<n;i++)if(a[i]==a[i-1])chong++;
	ans=n-chong;

	if((chong&1)==0)cout<<ans;
	else cout<<ans-1;
	
	return 0;
}