from collections import Counter



N = int(eval(input()))

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

c = Counter(a)



ref = [v-1 for k, v in list(c.items()) if v != 1]



ans = N - ((sum(ref)+1)//2)*2



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

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



uni = len(list(set(a)))

if uni % 2 == 0:

    uni -= 1



print(uni)
from collections import Counter

N = int(eval(input()))
a = list(map(int, input().split(" ")))
c = Counter(a)
ref = [v - 1 for k, v in list(c.items()) if v != 1]
ans = N - ((sum(ref) + 1) // 2) * 2
print(ans)

N = int(eval(input()))
a = list(map(int, input().split(" ")))
uni = len(list(set(a)))
if uni % 2 == 0:
    uni -= 1
print(uni)

-from collections import Counter - -c = Counter(a) -ref = [v - 1 for k, v in list(c.items()) if v != 1] -ans = N - ((sum(ref) + 1) // 2) * 2 -print(ans) +uni = len(list(set(a))) +if uni % 2 == 0: +    uni -= 1 +print(uni)