from collections import Counter



N = int(eval(input()))

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

C = Counter(A)

ans = len(C)

if (N-ans) % 2 == 1:

    ans -= 1

print(ans)

N = int(eval(input()))

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

S = set(A)

ans = len(S)

if (N-ans) % 2 == 1:

    ans -= 1

print(ans)

from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
C = Counter(A)
ans = len(C)
if (N - ans) % 2 == 1:
    ans -= 1
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
S = set(A)
ans = len(S)
if (N - ans) % 2 == 1:
    ans -= 1
print(ans)

-from collections import Counter - -C = Counter(A) -ans = len(C) +S = set(A) +ans = len(S)