from collections import defaultdict

import sys

N=int(eval(input()))

A=[int(i) for i in input().split() ]

dd=defaultdict(int)

for a in A:

    dd[a]+=1

L=[]

for j in list(dd.values()):

    L.append(j-1)

if len(L)==1 or len(L)==2:

    print((1))

    sys.exit()

if sum(L)%2==1:

    print((len(L)-1))

    sys.exit()

if sum(L)%2==0:

    print((len(L)))

    sys.exit()
from collections import defaultdict

N=int(eval(input()))

A=[int(i) for i in input().split()]

dd=defaultdict(int)

for a in A:

    dd[a]+=1

num=0

s=0

for p,n in list(dd.items()):

    num+=1

    if n%2==0:

        s+=1

        s%=2

print((num-s))

#print(num,s,dd)
from collections import defaultdict
import sys

N = int(eval(input()))
A = [int(i) for i in input().split()]
dd = defaultdict(int)
for a in A:
    dd[a] += 1
L = []
for j in list(dd.values()):
    L.append(j - 1)
if len(L) == 1 or len(L) == 2:
    print((1))
    sys.exit()
if sum(L) % 2 == 1:
    print((len(L) - 1))
    sys.exit()
if sum(L) % 2 == 0:
    print((len(L)))
    sys.exit()

from collections import defaultdict

N = int(eval(input()))
A = [int(i) for i in input().split()]
dd = defaultdict(int)
for a in A:
    dd[a] += 1
num = 0
s = 0
for p, n in list(dd.items()):
    num += 1
    if n % 2 == 0:
        s += 1
        s %= 2
print((num - s))
# print(num,s,dd)

-import sys -L = [] -for j in list(dd.values()): -    L.append(j - 1) -if len(L) == 1 or len(L) == 2: -    print((1)) -    sys.exit() -if sum(L) % 2 == 1: -    print((len(L) - 1)) -    sys.exit() -if sum(L) % 2 == 0: -    print((len(L))) -    sys.exit() +num = 0 +s = 0 +for p, n in list(dd.items()): +    num += 1 +    if n % 2 == 0: +        s += 1 +        s %= 2 +print((num - s)) +# print(num,s,dd)