n=int(eval(input()))

a=list(map(int,input().split()))

a.sort()

eq={}

for i in range(n-1):

  if a[i]==a[i+1]:

    if a[i] in eq:

      eq[a[i]]+=1

    else:

      eq[a[i]]=1

sousa=0

for i in list(eq.values()):

  sousa+=i

if sousa%2==0:

  print((n-sousa))

else:

  print((n-sousa-1))
from collections import Counter

N = int(eval(input()))

A = list(map(int, input().split()))

d = dict(Counter(A))

kaburi = 0

for key in d:

  kaburi += d[key]-1

  

print((N - (kaburi%2 + kaburi)))
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
eq = {}
for i in range(n - 1):
    if a[i] == a[i + 1]:
        if a[i] in eq:
            eq[a[i]] += 1
        else:
            eq[a[i]] = 1
sousa = 0
for i in list(eq.values()):
    sousa += i
if sousa % 2 == 0:
    print((n - sousa))
else:
    print((n - sousa - 1))

from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
d = dict(Counter(A))
kaburi = 0
for key in d:
    kaburi += d[key] - 1
print((N - (kaburi % 2 + kaburi)))

-n = int(eval(input())) -a = list(map(int, input().split())) -a.sort() -eq = {} -for i in range(n - 1): -    if a[i] == a[i + 1]: -        if a[i] in eq: -            eq[a[i]] += 1 -        else: -            eq[a[i]] = 1 -sousa = 0 -for i in list(eq.values()): -    sousa += i -if sousa % 2 == 0: -    print((n - sousa)) -else: -    print((n - sousa - 1)) +from collections import Counter + +N = int(eval(input())) +A = list(map(int, input().split())) +d = dict(Counter(A)) +kaburi = 0 +for key in d: +    kaburi += d[key] - 1 +print((N - (kaburi % 2 + kaburi)))