from collections import Counter



n = int(eval(input()))

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

cnt = Counter()

for i in range(n):

    cnt[a[i]] += 1



for a in cnt:

    cnt[a] %= 2

z_o = list(cnt.values())



if list(z_o).count(0) % 2 == 0:

    print((len(cnt)))

else:

    print((len(cnt) - 1))

n = int(eval(input()))

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

a_set = set(a)



if len(a_set) % 2 == 0:

    print((len(a_set) - 1))

else:

    print((len(a_set)))

from collections import Counter

n = int(eval(input()))
a = list(map(int, input().split()))
cnt = Counter()
for i in range(n):
    cnt[a[i]] += 1
for a in cnt:
    cnt[a] %= 2
z_o = list(cnt.values())
if list(z_o).count(0) % 2 == 0:
    print((len(cnt)))
else:
    print((len(cnt) - 1))

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

-from collections import Counter - -cnt = Counter() -for i in range(n): -    cnt[a[i]] += 1 -for a in cnt: -    cnt[a] %= 2 -z_o = list(cnt.values()) -if list(z_o).count(0) % 2 == 0: -    print((len(cnt))) +a_set = set(a) +if len(a_set) % 2 == 0: +    print((len(a_set) - 1)) -    print((len(cnt) - 1)) +    print((len(a_set)))