from collections import Counter



N = int(eval(input()))

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



C = Counter(lst)

odd = 0

even = 0

for c in C:

    if C[c] % 2 == 0:

        even += 1

    else:

        odd += 1



if even % 2 == 0:

    print((len(C)))

else:

    print((len(C) - 1))

N = int(eval(input()))

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



s = len(set(lst))

print(((s - 1)//2 * 2 + 1))
from collections import Counter

N = int(eval(input()))
lst = list(map(int, input().split()))
C = Counter(lst)
odd = 0
even = 0
for c in C:
    if C[c] % 2 == 0:
        even += 1
    else:
        odd += 1
if even % 2 == 0:
    print((len(C)))
else:
    print((len(C) - 1))

N = int(eval(input()))
lst = list(map(int, input().split()))
s = len(set(lst))
print(((s - 1) // 2 * 2 + 1))

-from collections import Counter - -C = Counter(lst) -odd = 0 -even = 0 -for c in C: -    if C[c] % 2 == 0: -        even += 1 -    else: -        odd += 1 -if even % 2 == 0: -    print((len(C))) -else: -    print((len(C) - 1)) +s = len(set(lst)) +print(((s - 1) // 2 * 2 + 1))