def main():

    N = int(eval(input()))

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

    set_A = set(A)



    if len(set_A) % 2 == 0:

        print((len(set_A)-1))

    else:

        print((len(set_A)))



if __name__ == "__main__":

    main()
from collections import defaultdict



def main():

    N = int(eval(input()))

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

    A = set(A)

    if len(A) % 2 == 0:

        print((len(A) - 1))

    else:

        print((len(A)))







if __name__ == "__main__":

    main()
def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    set_A = set(A)
    if len(set_A) % 2 == 0:
        print((len(set_A) - 1))
    else:
        print((len(set_A)))


if __name__ == "__main__":
    main()

from collections import defaultdict


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


if __name__ == "__main__":
    main()

+from collections import defaultdict + + -    set_A = set(A) -    if len(set_A) % 2 == 0: -        print((len(set_A) - 1)) +    A = set(A) +    if len(A) % 2 == 0: +        print((len(A) - 1)) -        print((len(set_A))) +        print((len(A)))