def main():

    N = int(eval(input()))

    A = [int(i) for i in input().split()]

    from collections import Counter

    c = Counter(A)

    even = len([v for v in list(c.values()) if v % 2 == 0])

    ans = len(list(c.keys()))

    if even % 2 == 1:

        ans -= 1

    print(ans)





if __name__ == '__main__':

    main()

def main():

    """

    奇数枚の余りは1に、偶数枚の余りは2にできる

    偶数枚が偶数個余っていたら種類は減らないが、奇数個であれあ一つ種類が減る

    """

    _ = int(eval(input()))

    A = [int(i) for i in input().split()]

    from collections import Counter

    c = Counter(A)

    even = len([v for v in list(c.values()) if v % 2 == 0])

    ans = len(list(c.keys()))

    if even % 2 == 1:

        ans -= 1

    print(ans)





if __name__ == '__main__':

    main()

def main():
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    from collections import Counter

    c = Counter(A)
    even = len([v for v in list(c.values()) if v % 2 == 0])
    ans = len(list(c.keys()))
    if even % 2 == 1:
        ans -= 1
    print(ans)


if __name__ == "__main__":
    main()

def main():
    """
    奇数枚の余りは1に、偶数枚の余りは2にできる
    偶数枚が偶数個余っていたら種類は減らないが、奇数個であれあ一つ種類が減る
    """
    _ = int(eval(input()))
    A = [int(i) for i in input().split()]
    from collections import Counter

    c = Counter(A)
    even = len([v for v in list(c.values()) if v % 2 == 0])
    ans = len(list(c.keys()))
    if even % 2 == 1:
        ans -= 1
    print(ans)


if __name__ == "__main__":
    main()

-    N = int(eval(input())) +    """ +    奇数枚の余りは1に、偶数枚の余りは2にできる +    偶数枚が偶数個余っていたら種類は減らないが、奇数個であれあ一つ種類が減る +    """ +    _ = int(eval(input()))