n = eval(input())

n = int(n)

a = input().split()

a = [int(x) for x in a]



b = set(a)

res = len(b)

if n % 2 != res % 2:

    res -= 1

print(res)
import sys



# sys.stdin = open('d1.in')





def read_int_list():

    return list(map(int, input().split()))





def read_str_list():

    return input().split()





def read_int():

    return int(eval(input()))





def read_str():

    return eval(input())



n = read_int()

a = read_int_list()



b = set(a)

res = len(b)

if res % 2 != 1:

    res -= 1

print(res)

n = eval(input())
n = int(n)
a = input().split()
a = [int(x) for x in a]
b = set(a)
res = len(b)
if n % 2 != res % 2:
    res -= 1
print(res)

import sys

# sys.stdin = open('d1.in')
def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(eval(input()))


def read_str():
    return eval(input())


n = read_int()
a = read_int_list()
b = set(a)
res = len(b)
if res % 2 != 1:
    res -= 1
print(res)

-n = eval(input()) -n = int(n) -a = input().split() -a = [int(x) for x in a] +import sys + +# sys.stdin = open('d1.in') +def read_int_list(): +    return list(map(int, input().split())) + + +def read_str_list(): +    return input().split() + + +def read_int(): +    return int(eval(input())) + + +def read_str(): +    return eval(input()) + + +n = read_int() +a = read_int_list() -if n % 2 != res % 2: +if res % 2 != 1: