from collections import defaultdict





def main():

    n = int(eval(input()))

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



    ans = len(set(card_list))



    d = defaultdict(int)

    for card in card_list:

        d[card] += 1



    one, two = 0, 0

    for card, num in list(d.items()):

        if num % 2 == 1:

            one += 1

        else:

            two += 1



    print((ans - two % 2))





if __name__ == '__main__':

    main()

from collections import defaultdict





def main():

    n = int(eval(input()))

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

    s = len(set(a_list))

    if (len(a_list) - s) % 2 != 0:

        print((s - 1))

    else:

        print(s)





if __name__ == '__main__':

    main()

from collections import defaultdict


def main():
    n = int(eval(input()))
    card_list = list(map(int, input().split()))
    ans = len(set(card_list))
    d = defaultdict(int)
    for card in card_list:
        d[card] += 1
    one, two = 0, 0
    for card, num in list(d.items()):
        if num % 2 == 1:
            one += 1
        else:
            two += 1
    print((ans - two % 2))


if __name__ == "__main__":
    main()

from collections import defaultdict


def main():
    n = int(eval(input()))
    a_list = list(map(int, input().split()))
    s = len(set(a_list))
    if (len(a_list) - s) % 2 != 0:
        print((s - 1))
    else:
        print(s)


if __name__ == "__main__":
    main()

-    card_list = list(map(int, input().split())) -    ans = len(set(card_list)) -    d = defaultdict(int) -    for card in card_list: -        d[card] += 1 -    one, two = 0, 0 -    for card, num in list(d.items()): -        if num % 2 == 1: -            one += 1 -        else: -            two += 1 -    print((ans - two % 2)) +    a_list = list(map(int, input().split())) +    s = len(set(a_list)) +    if (len(a_list) - s) % 2 != 0: +        print((s - 1)) +    else: +        print(s)