#include <cstdio>
int n, in, a[100001], c[3];
int main()
{
    scanf("%d",&n);
    for(int i = 0;i < n;i++)
    {
        scanf("%d",&in);
        a[in]++;
    }
    for(int i = 0;i < 100001;i++)
    {
        if(a[i] == 0) c[0]++;
        else if(a[i]%2 == 0) c[2]++;
        else c[1]++;
    }
    printf("%d",c[1] + c[2] - c[2]%2);
}
