n = int(eval(input()))

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



l = []

a.sort()



i = 0

num = 1

while i < len(a) - 1:

    if a[i+1] == a[i]:

        num += 1

        i += 1

    else:

        l.append(num)

        num = 1

        i += 1

l.append(num)



count = 0

for i in range(len(l)):

    if l[i] % 2 == 1:

        l[i] = 1

    else:

        count += 1

        l[i] = 1



if count % 2 == 0:

    print((sum(l)))

else:

    print((sum(l) - 1))
n = int(eval(input()))

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



l = []

a.sort()



num = 1

for i in range(len(a)-1):

    if a[i+1] == a[i]:

        num += 1

    else:

        l.append(num)

        num = 1

l.append(num)



count = 0

for i in range(len(l)):

    if l[i] % 2 == 1:

        l[i] = 1

    else:

        count += 1

        l[i] = 1



if count % 2 == 0:

    print((sum(l)))

else:

    print((sum(l) - 1))
n = int(eval(input()))
a = list(map(int, input().split()))
l = []
a.sort()
i = 0
num = 1
while i < len(a) - 1:
    if a[i + 1] == a[i]:
        num += 1
        i += 1
    else:
        l.append(num)
        num = 1
        i += 1
l.append(num)
count = 0
for i in range(len(l)):
    if l[i] % 2 == 1:
        l[i] = 1
    else:
        count += 1
        l[i] = 1
if count % 2 == 0:
    print((sum(l)))
else:
    print((sum(l) - 1))

n = int(eval(input()))
a = list(map(int, input().split()))
l = []
a.sort()
num = 1
for i in range(len(a) - 1):
    if a[i + 1] == a[i]:
        num += 1
    else:
        l.append(num)
        num = 1
l.append(num)
count = 0
for i in range(len(l)):
    if l[i] % 2 == 1:
        l[i] = 1
    else:
        count += 1
        l[i] = 1
if count % 2 == 0:
    print((sum(l)))
else:
    print((sum(l) - 1))

-i = 0 -while i < len(a) - 1: +for i in range(len(a) - 1): -        i += 1 -        i += 1