from collections import Counter



n=int(eval(input()))

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



c=Counter(a)



cnt=0

ans=0



for v in list(c.values()):

  ans+=1

  if v%2==0:

    cnt+=1



if cnt%2==1:

  ans-=1



print(ans)
n=int(eval(input()))

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

al=len(a)

print((al if al%2==1 else al-1))
from collections import Counter

n = int(eval(input()))
a = list(map(int, input().split()))
c = Counter(a)
cnt = 0
ans = 0
for v in list(c.values()):
    ans += 1
    if v % 2 == 0:
        cnt += 1
if cnt % 2 == 1:
    ans -= 1
print(ans)

n = int(eval(input()))
a = set(list(map(int, input().split())))
al = len(a)
print((al if al % 2 == 1 else al - 1))

-from collections import Counter - -a = list(map(int, input().split())) -c = Counter(a) -cnt = 0 -ans = 0 -for v in list(c.values()): -    ans += 1 -    if v % 2 == 0: -        cnt += 1 -if cnt % 2 == 1: -    ans -= 1 -print(ans) +a = set(list(map(int, input().split()))) +al = len(a) +print((al if al % 2 == 1 else al - 1))