#include<iostream>
#include<cstdio>
using namespace std;
const int maxn=100005;
int n,ans,num;
char ch;
bool vis[maxn]={0};
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);
	int a;
	ans=0;
	int chong=0;
	for(int i=0;i<n;i++){
		a=get_num();
		if(vis[a])chong++;
		else vis[a]=true;
	}
	
	ans=n-chong;

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