#include<bits/stdc++.h>
using namespace std;

int a[100010],n;

int main(){
    scanf("%d",&n);
    for(int i=0;i<n;i++) scanf("%d",&a[i]);
    sort(a,a+n);
    int count=unique(a,a+n)-a;
    printf("%d\n",count-(count%2==0?1:0));
    return 0;
}