#include<iostream>
#include<vector>
#include<numeric>
using namespace std;

int main(){
    int n,a;
    cin>>n;
    vector<int>k(100000+1,0);
    for(int i=0;i<n;i++){
        cin>>a;
        if(!k[a])k[a]++;
    }
    int ans=accumulate(k.begin(),k.end(),0);
    cout<<(ans%2?ans:ans-1)<<endl;
    return 0;
}