n=int(eval(input()))

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

from collections import Counter

import heapq

cou=Counter(a)

c=[]

for k in list(cou.keys()):

    c.append((-cou[k], k))

heapq.heapify(c)

v1,k1=heapq.heappop(c)

while v1<-1:

    if v1<-2:

        v1+=2

        heapq.heappush(c, (v1,k1))

    else:

        v2,k2=heapq.heappop(c)

        if v2<0:

            v1+=1

            v2+=1

            heapq.heappush(c, (v1,k1))

            heapq.heappush(c, (v2,k2))

    v1,k1=heapq.heappop(c)

    #print(v1,k1,c)

c.append((v1,k1))

cnt=0

for v,k in c:

    if v==-1:

        cnt+=1

print(cnt)
n=int(eval(input()))

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



x=len(set(a))

if x%2==1:

    print(x)

else:

    print((x-1))

n = int(eval(input()))
a = list(map(int, input().split()))
from collections import Counter
import heapq

cou = Counter(a)
c = []
for k in list(cou.keys()):
    c.append((-cou[k], k))
heapq.heapify(c)
v1, k1 = heapq.heappop(c)
while v1 < -1:
    if v1 < -2:
        v1 += 2
        heapq.heappush(c, (v1, k1))
    else:
        v2, k2 = heapq.heappop(c)
        if v2 < 0:
            v1 += 1
            v2 += 1
            heapq.heappush(c, (v1, k1))
            heapq.heappush(c, (v2, k2))
    v1, k1 = heapq.heappop(c)
    # print(v1,k1,c)
c.append((v1, k1))
cnt = 0
for v, k in c:
    if v == -1:
        cnt += 1
print(cnt)

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

-from collections import Counter -import heapq - -cou = Counter(a) -c = [] -for k in list(cou.keys()): -    c.append((-cou[k], k)) -heapq.heapify(c) -v1, k1 = heapq.heappop(c) -while v1 < -1: -    if v1 < -2: -        v1 += 2 -        heapq.heappush(c, (v1, k1)) -    else: -        v2, k2 = heapq.heappop(c) -        if v2 < 0: -            v1 += 1 -            v2 += 1 -            heapq.heappush(c, (v1, k1)) -            heapq.heappush(c, (v2, k2)) -    v1, k1 = heapq.heappop(c) -    # print(v1,k1,c) -c.append((v1, k1)) -cnt = 0 -for v, k in c: -    if v == -1: -        cnt += 1 -print(cnt) +x = len(set(a)) +if x % 2 == 1: +    print(x) +else: +    print((x - 1))