import collections

n = int(input())

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

cc = collections.Counter(ais)

k = n - len(cc)

print(len(cc) - (1 if (n - len(cc)) % 2 == 1 else 0))

n,s = int(input()),set(map(int, input().split()))

print(len(s) - (1 if (len(s) & 1 == 0) else 0))
import collections

n = int(input())
ais = list(map(int, input().split()))
cc = collections.Counter(ais)
k = n - len(cc)
print(len(cc) - (1 if (n - len(cc)) % 2 == 1 else 0))

n, s = int(input()), set(map(int, input().split()))
print(len(s) - (1 if (len(s) & 1 == 0) else 0))

-import collections - -n = int(input()) -ais = list(map(int, input().split())) -cc = collections.Counter(ais) -k = n - len(cc) -print(len(cc) - (1 if (n - len(cc)) % 2 == 1 else 0)) +n, s = int(input()), set(map(int, input().split())) +print(len(s) - (1 if (len(s) & 1 == 0) else 0))