from collections import Counter

N = eval(input())

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

hist = Counter(CARDS)

dup = N - len(hist)

eat = (dup+1)/2

print(N - eat*2)
from collections import Counter

N = int(eval(input()))

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

ctr = Counter(src)

even = len([a for a in list(ctr.values()) if a%2==0])

ans = len(ctr)

if even%2:

    ans -= 1

print(ans)
from collections import Counter

N = eval(input())
CARDS = list(map(int, input().split()))
hist = Counter(CARDS)
dup = N - len(hist)
eat = (dup + 1) / 2
print(N - eat * 2)

from collections import Counter

N = int(eval(input()))
src = list(map(int, input().split()))
ctr = Counter(src)
even = len([a for a in list(ctr.values()) if a % 2 == 0])
ans = len(ctr)
if even % 2:
    ans -= 1
print(ans)

-N = eval(input()) -CARDS = list(map(int, input().split())) -hist = Counter(CARDS) -dup = N - len(hist) -eat = (dup + 1) / 2 -print(N - eat * 2) +N = int(eval(input())) +src = list(map(int, input().split())) +ctr = Counter(src) +even = len([a for a in list(ctr.values()) if a % 2 == 0]) +ans = len(ctr) +if even % 2: +    ans -= 1 +print(ans)